Jump to content

PHP Display Issues


Guest

Recommended Posts

Now I am getting:

 

Use of undefined constant  - assumed 'cust_no' in C:\wamp\www\flow\query\111.php on line 25

 

Use of undefined constant office - assumed 'office' in C:\wamp\www\flow\query\111.php on line 26

 

Use of undefined constant fname - assumed 'fname' in C:\wamp\www\flow\query\111.php on line 30

 

Use of undefined constant lname - assumed 'lname' in C:\wamp\www\flow\query\111.php on line 31

 

In the browser when I go to this file....what am I missing? Please see my simple code....basically, I'm just trying to pull data from a MySQL database to view in a browser & I think I am either missinh a " or ' or need to add one somewhere......thanks

 



<html
<head>
<?php
require('connection.php');

if (isset($_GET['op']) && $_GET['op'] == "d") 
if($_GET['op'] == "d" && !empty($_GET['id']) )
{

   $result = mysql_query($query) or die(mysql_error());  
}

$query="SELECT fid, cust_no, fname, lname, office FROM psrinfo";
$result = mysql_query($query) or die(mysql_error());  

while($row = mysql_fetch_array( $result )) {
?>
  
<?php } 

echo '<form action="111.php" method="post">

<table width="75%" border="1">
<tr>
<td><b>Customer No:</b> <br><input type="text" name="cust_no" size="25" maxlength="30" value="'. $row[cust_no] .'" /><br> </td>
<td><b>Office:</b> <br><input type="text" name="office" size="25" maxlength="30" value="'. $row[office] .'" /><br> </td> 
</tr>

<tr>
<td><b>Customer First Name:</b> <br><input type="text" name="fname" size="25" maxlength="30" value="'. $row[fname] .'" /><br> </td>
<td><b>Customer Last Name:</b> <br><input type="text" name="lname" size="25" maxlength="30" value="'. $row[lname] .'" /><br> </td>
</tr>

</table>
</form>';
mysql_close(); // Close the database connection.
?>           
</tbody>
</table>

Link to comment
https://forums.phpfreaks.com/topic/231615-php-display-issues/
Share on other sites

Problem should be gone and don't screw around with coding if you don't understanding it are we clear ?  :rtfm:

<?php
require('connection.php');

if (isset($_GET['op']) && $_GET['op'] == "d") 
if($_GET['op'] == "d" && !empty($_GET['id']) )
{

   $result = mysql_query($query) or die(mysql_error());  
}

$query="SELECT fid, cust_no, fname, lname, office FROM psrinfo";
$result = mysql_query($query) or die(mysql_error());  

while($row = mysql_fetch_array( $result )) 
{
echo "<table width='75%' border='1' align='center' cellpadding='0' cellspacing='0'>
  <tr>
    <th scope='col'><form name='form1' method='post' action=''>
     Customer No:
        <input name='cust_no' type='text' id='cust_no' value='{$row['cust_no']}'>
      <br>
      
      <b>Office:</b>
      <input name='office' type='text' id='office' value='{$row['office']}'>
		<br>
      <b>Customer First Name:</b>
      <input name='fname' type='text' id='fname' value='{$row['fname']}'>
	<br>
      <b>Customer Last Name:</b>
      <input name='lname' type='text' id='lname' value='{$row['lname']}'>
    </form></th>
  </tr>
</table>";
}
?>     

Link to comment
https://forums.phpfreaks.com/topic/231615-php-display-issues/#findComment-1191853
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.