|
|
|
|
![]() ![]() |
Apr 20 2005, 07:01 AM
Post
#1
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 70 Joined: 14-April 05 Member No.: 5,653 |
i put up a PHP and MYSQL site recently, which was hosted on tripod(loosers), where it used to work fine,
i put i up here again, it says: CODE Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/tariq/public_html/fsgr/script/orders.php on line 47 what does this mean, is the PHP or MYSQL version up to date?? or is there somthing wrong with my coding, Please help Tariq |
|
|
|
Apr 20 2005, 09:55 PM
Post
#2
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 629 Joined: 26-February 05 Member No.: 3,995 |
Something's wrong with your code. That happens to me a lot, too. I can usually fix it by just messing around with how I do the query. It's also sometimes a problem with variables getting lost. Try making it echo the query ($query = etc.; mysql_query($query); echo $query;) to see if it's doing it right.
|
|
|
|
Apr 21 2005, 06:46 AM
Post
#3
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 70 Joined: 14-April 05 Member No.: 5,653 |
QUOTE(beeseven @ Apr 20 2005, 09:55 PM) Something's wrong with your code. That happens to me a lot, too. I can usually fix it by just messing around with how I do the query. It's also sometimes a problem with variables getting lost. Try making it echo the query ($query = etc.; mysql_query($query); echo $query;) to see if it's doing it right. CODE <? $res = mysql_query("select * from orders"); while($row = mysql_fetch_array($res)) { print "<tr><td valign=top>" . $row['orderid'] . "</td><td>" . $row['name'] . "</td><td>" . $row['tel'] . "</td><td>" . $row['address'] . "</td><td>" . $row['cart'] . "</td><td>" . $row['comments'] . "</td><td><a href=\"delete.php?id=" . $row['id'] . "\">delete</a></td></tr>"; } ?> this is the full code,,, whats wrong??? |
|
|
|
Apr 21 2005, 12:54 PM
Post
#4
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 29 Joined: 6-April 05 Member No.: 5,318 |
More than likely you didn't created the table orders, or perhaps there I no data there.
So make sure the table exists, has some columns is it, and has some data (but this really shouldn't matter) |
|
|
|
Apr 21 2005, 02:40 PM
Post
#5
|
|
|
Ancient Enigma ![]() Group: [MODERATOR] Posts: 1,771 Joined: 11-July 04 From: under the stars Member No.: 76 |
when you transferred your site from tripod, you should look into it that you did not just transfer the PHP files only, but also the MYSQL database accessed by your pages as well. if you desire to start from scratch with your database, just create the appropriate DB from your cpanel.
if it has been working with tripod before, there's no reason it wouldn't run with trap17 too. |
|
|
|
Apr 22 2005, 07:36 AM
Post
#6
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 70 Joined: 14-April 05 Member No.: 5,653 |
COOL!! IT WORKS!! i really donno what i did, but it finally works!!
omg, Thanx guyz, T. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th September 2008 - 12:15 PM |