Jump to content

Recommended Posts

Good day all,

I have an update.php script that is not working.

I think the problem is the query string and the mysql_numrow function

below.

My other scripts of output and insert work fine. In vi, all color

syntax matches except for the mysql_numrows function. It is

white where the other functions are normal lite blue.

When I take the single quotes out from '$id' the colors match and

mysql_numrows() becomes lite blue but the script still does not

work and it needs those quote. I get a blank update.php page in the browser.

I would like to post the entire script but the rules say

no php variables.

Has anyone had this situation before. Thanks in advance.

 

 

mysql_connect("192.168.2.6",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM contacts WHERE id='$id'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();

 

Link to comment
https://forums.phpfreaks.com/topic/55850-solved-mysql_numrows-problem-i-think/
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.