By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

when running the code I am getting this problem: ( ! ) Parse error: syntax error, une

P: 1
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.     <head>
  4.         <title> Soon Fat Restaurant/Home </title>
  5.     </head>
  6.     <body> 
  7.         <hr color="#FBB917" size="3">
  8.         <p style=" font-size:40pt; color:#153E7E; text-align:center">
  9.             SooN Fat<br/>
  10.         <span style=" font-size:30pt; color:#153E7E; text-align:center">
  11.             Restaurant </span><br/>
  12.         <hr color="#FBB917" size="3">
  13.          </p>
  14.  
  15.  
  16.     <table border="0" align="center" cellpadding="5">
  17.         <tr align="center"> 
  18.         <td> <a href="Home.html"> <font color=red size=5pt>Home </font> </a> </td>
  19.         <td>  </td>
  20.         <td> <a href="Menu.php"><font color=red size=5pt> Menu </font></a></td>
  21.         <td>  </td>
  22.         <td> <a href="Reservation.php"> <font color=red size=5pt>Log in/Create Account</font></a></td>
  23.         <td>  </td>
  24.         <td><a href="Viewall.php"><font color=red size=5pt> View all Accounts</font> </a><td>
  25.         <td>  </td>
  26.         <td><a href="View.php"><font color=red size=5pt> Search for one Account</font> </a><td>
  27.         <td>  </td>
  28.         <td><a href="ContactUs.php"><font color=red size=5pt> Contact Us </font> </a><td>
  29.         </tr>
  30.     </table>
  31.         <hr color="#FBB917" size="3" >
  32. <?php
  33.     $db=mysql_connect("localhost","root","");
  34.  
  35.  
  36.     //Select the customer database
  37.     $er= mysql_select_db("customer");
  38.  
  39.     $query= "SELECT * FROM `personalinfo`;
  40.     print $query;
  41.     $result= mysql_query($query); 
  42.     print <table><caption> <h2> Query results </h2> </caption> ;
  43.     print <tr align='center'>;
  44.  
  45.     $num_rows= mysql_num_rows($result);
  46.     $row= mysql_fetch_array($result);
  47.     $num_fields = mysql_num_fields($result);
  48.  
  49.     //produce the colum label
  50.     $keys = array_keys($row);
  51.     for($index= 0; $index < $num_fields; $index++)
  52.         $i= 2* $index +1;
  53.         print <th> php . $keys[$i] . </th>;
  54.     print </tr>;
  55.  
  56.     //output the values of the fields in the rows
  57.     for($row_num=0; $row_num < $num_rows; $row_num++)
  58.     {
  59.         print <tr align='center'>;
  60.         $values = array_values($row);
  61.         for($index=0; $index < $num_fields; $index++)
  62.          {
  63.             $i= 2* $index +1;
  64.             $value=htmlspecialchars($values[$i]);
  65.             print <th> . $value . </th>;
  66.          }
  67.         print </tr>;
  68.         $row= mysql_fetch_array($result);
  69.     }
  70. print </table>;
  71. ?></body>
  72. </html>
May 5 '12 #1
Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,370
Please use code tags when posting code.

You haven't posted the full error code.
May 5 '12 #2

Dormilich
Expert Mod 5K+
P: 8,639
there are lots of missing quotation marks.
May 5 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.