Jump to content

[SOLVED] Fatal Error and It's Killing Me


phpretard

Recommended Posts

Does anyone know why I would get this? Fatal error: Can't use function return value in write context

 

$SEARCH="AB";

if (!ereg('[^A-Z]', $SEARCH) && (strlen($SEARCH) = 2))){

$searchResult = mysql_query("
SELECT * FROM members WHERE 
LicState LIKE '%$SEARCH%' OR 
LicState2 '%$SEARCH%' OR 
LicState3 LIKE '%$SEARCH%' OR 
LicState4 LIKE '%$SEARCH%' ");}

if (!searchResult){die(mysql_error());}

$num_rows= mysql_num_rows($searchResult);

echo $num_rows." FOUND";

 

I am looking for: "1 FOUND" ...and I get: Fatal error: Can't use function return value in write context

 

Thank again!

 

Link to comment
Share on other sites

I took your advise on both post (THANK YOU!)

 

I now get: mysql_num_rows(): supplied argument is not a valid MySQL result resource...on line 17

 

if (!ereg('[^A-Z]', $SEARCH) && (strlen($SEARCH) == 2)){

$searchResult = mysql_query("
SELECT * FROM members WHERE 
LicState LIKE '%$SEARCH%' OR 
LicState2 '%$SEARCH%' OR 
LicState3 LIKE '%$SEARCH%' OR 
LicState4 LIKE '%$SEARCH%' ");}

if (!searchResult){die(mysql_error());}

$num_rows= mysql_num_rows($searchResult); << -------- LINE 17

echo $num_rows." FOUND";

}

 

Any ideas on this?

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.