|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-10-06 10:06 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 00:00:02 2025 UTC |
Description: ------------ $query = 'SELECT * FROM emp WHERE empid="$empid"' ; query is not getting executed if i'm using $empid as variable. if i'm providing direct empid which i have defined as INT then it is working good. Reproduce code: --------------- $empid=FALSE; $ename=FALSE; $dept=FALSE; $sal=FALSE; $empid=$_POST["empid"]; $ename=$_POST["ename"]; $dept=$_POST["dept"]; $sal=$_POST["salary"]; If ($empid==TRUE) { $query = 'SELECT * FROM emp WHERE empid="$empid"' ; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); //echo "$result"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "\t<tr>\n"; foreach ($line as $col_value) { echo "\t\t<td align=center>$col_value</td>\n"; } echo "\t</tr>\n"; } echo "</table>\n"; //Free resultset mysql_free_result($result); Expected result: ---------------- full details about that row... Actual result: -------------- getting blank page