Jump to content

Odd php issue with mysql strings.


whelpton

Recommended Posts

Hey guys, I have used this code before on a linux server and know that it works, however after porting my site over to a windows server running apache, php and mysql; the following code seems to make one of my scripts crash.

 

 

$queryfam1 = "SELECT * FROM wp_users WHERE user_login='$username'";

$resultfam1 = mysql_query($queryfam1) or die(mysql_error());

$row21 = mysql_fetch_array($resultfam1) or die(mysql_error());

 

 

I have no idea of a result as there is no error reported, it simply dies and does not tell me what is happening with it.

 

Any ideas?

Link to comment
Share on other sites

Putting or die(mysql_error()) on the end of a mysql_fetch_xxxxx() statement makes no sense, because mysql_fetch_xxxxx() statements don't set mysql_error() and the original code would die() with nothing being output to the browser when the query matches zero rows.

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.