Jump to content

[SOLVED] error message


littlepeg

Recommended Posts

Hi, everybody.  :)I met a problem and hope you can help me. Any help will be appreciated.

I developed my first php website on my computer and tested it by using my university web domain, and it worked fine. However, when I upload this website to the other web domain that I applied. One of my web page cannot work properly, and shows error message: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/adtsfxfg/public_html/edit_user1.php on line 236. The codes are as follows:

$query = "SELECT user_name, first_name, last_name, address, postcode, tel, email, agreetolist FROM users WHERE user_id=$id";		
$result = @mysql_query ($query); // Run the query.

[color=red]if (mysql_num_rows($result) == 1) { // Valid user ID, show the form.[/color] 

// Get the user's information.
$row = mysql_fetch_array ($result, MYSQL_NUM);


  Would you please tell me why it works on one web domain but can't work on the other web domain. And how can I solve this problems. Thank you.

 

 

Link to comment
Share on other sites

Humm

 

you didn't get an extra message ie

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in

 

also you did use exaclty what i posted (removing the @ as well)

can you post what the following outputs

 

$query = "SELECT user_name, first_name, last_name, address, postcode, tel, email, agreetolist FROM users WHERE user_id=$id";
echo $query;
$result = mysql_query ($query) or die(mysql_error()); // Run the query.
$x = mysql_num_rows($result);

if ($x == 1) { // Valid user ID, show the form.

// Get the user's information.
$row = mysql_fetch_array ($result, MYSQL_NUM);


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.