php - notice undefined constant assumed MySql -
here code working after installing new wamp server in new mini compaq laptop? errors:
$sno=mysql_result($result,$m,"sno"); $name=mysql_resul($result,$m,"name"); $location=mysql_result($result,$m,"location"); $sector=mysql_result($result,$m,"sector"); $status=mysql_result($result,$m,"status");*/?> <table width="320" border="0"cellspacing="0"> <tr> <strong> <td width="194"><strong><span class="style16"><font face="lucida console, lucida sans unicode">pv no:</font></span></strong></td> <td width="110" nowrap><span class="style16"><strong><?php echo "$_post[pvno]";?></strong></span></td></strong> </tr> <tr> <td width="194"><span class="style16"><strong><font face="lucida console, lucida sans unicode">sno</font></strong></span></td> <td width="110" nowrap><span class="style16"><?php echo ''.$sno.''; ?></span></td> </tr> <tr> <td><span class="style16"><strong><font face="lucida console, lucida sans unicode">project name </font></strong></span></td> <td nowrap><span class="style16"><strong><?php echo $name;?></strong></span></td> </tr> <tr> <td><span class="style16"><strong>sector</strong></span></td> <td nowrap><span class="style16"><?php echo $sector;?></span></td> </tr> <tr> <td><span class="style16"><strong>contractor</strong></span></td> <td nowrap><span class="style16"><?php echo $contractor;?></span></td> </tr> <tr> <td><span class="style16"><strong>contacts</strong></span></td> <td nowrap><span class="style16"><?php echo $contact;?></span></td> </tr> <tr> <td><span class="style16"><strong>location</strong></span></td> <td nowrap><span class="style16"><?php echo $location;?></span></td> </tr> <tr> <td><span class="style16"><strong>status</strong></span></td> <td nowrap><span class="style16"><?php echo $status; ?></span></td> </tr> </table>
the output error due is:
pv no: agri008 sno notice: undefined variable: sno in c:\wamp\www\cdf\new pro\pvsearch.php on line 162 project name notice: undefined variable: name in c:\wamp\www\cdf\new pro\pvsearch.php on line 166 sector notice: undefined variable: sector in c:\wamp\www\cdf\new pro\pvsearch.php on line 170 contractor notice: undefined variable: contractor in c:\wamp\www\cdf\new pro\pvsearch.php on line 174 contacts notice: undefined variable: contact in c:\wamp\www\cdf\new pro\pvsearch.php on line 178 location notice: undefined variable: location in c:\wamp\www\cdf\new pro\pvsearch.php on line 182 status notice: undefined variable: status in c:\wamp\www\cdf\new pro\pvsearch.php on line 186
any please appreciated enter code here
<?php echo "$_post[pvno]";?>
pvno
not within quotes, treated constant, constant doesn't exists (thats notice tries tell you)
use instead
<?php echo $_post['pvno'];?>
there no reason double quotes around variable.
additional
<?php echo ''.$sno.''; ?>
quotes useless here to
<?php echo $sno; ?>
Comments
Post a Comment