Advertisement

Ajax Poll Weird Issue

Moderators: Calcifer, slothy

Ajax Poll Weird Issue

Postby skyler » Thu Mar 13, 2008 6:07 pm

I am having a bit of trouble getting the Ajax-Poll running.

0. Edited mysql connection strings in all 3 docs.
1. I have changed the files extensions to php in both htm files.
2. I edited the $pollerId = 1; // Id of poller from $pollerId = 3; // Id of poller

3. I get this error in ajax-poller that says:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/thissite/public_html/poll/ajax-poller.php on line 63

this line 63 is: $res = mysql_query("select * from poller where ID='$pollerId'");

4. I get this error in admin that says:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/thissite/public_html/poll/admin/adm-poller.php on line 115

this line 115 says: $res = mysql_query("select * from poller order by pollerTitle");

Opening MySQL shows no tables have been created. Does anyone see what may be happening?

Thanks - Skyler

PS - I am using: MySQL client version: 4.1.22
skyler
 
Posts: 2
Joined: Thu Mar 13, 2008 5:50 pm

I fixed It

Postby skyler » Thu Mar 13, 2008 6:57 pm

Well, since it has been a whole twenty minutes I think...I have found the reason why all of the afore mentioned stuff was happening. I had to go edit my connection string.

The string in createDbTable would not work. In case this happens to you try the following:

$conn = mysql_connect("localhost","user-name",password");
mysql_select_db("db-name",$conn);

Change to this:

$conn=mysql_connect ("localhost", "user-name", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("db-name",$conn);

Now it functions great. Off to the races. Best wishes - Sky
skyler
 
Posts: 2
Joined: Thu Mar 13, 2008 5:50 pm


Return to General questions regarding AJAX scripts

Who is online

Users browsing this forum: No registered users and 24 guests

cron