adap Posted February 3, 2010 Share Posted February 3, 2010 <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="sk39_properties"; // Database name $tbl_name="properties"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // select record from mysql $sql="SELECT * FROM properties"; $result=mysql_query($sql); ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td><table width="400%" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td bgcolor="#FFFFFF"> </td> <td colspan="4" bgcolor="#FFFFFF"><strong>Delete data in mysql</strong> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Unit Number</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Land Title</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Tenure</strong></td> <td align="center" bgcolor="#FFFFFF"> </td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['UnitNumber']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['LandTitle']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['Tenure']; ?></td> <td bgcolor="#FFFFFF"><a href="delete_ac.php?id=<? echo $rows['id']; ?>">delete</a></td> </tr> <? // close while loop } // close connection; mysql_close(); ?> </table></td> </tr> </table> Above is my code. And when i try to run it, it states that i got parse error at line 53. Anyone can help? Thanks. Truly appreciate it. Quote Link to comment Share on other sites More sharing options...
gizmola Posted February 3, 2010 Share Posted February 3, 2010 Probably because you tried to use a short tag here: delete Change the to <?php Quote Link to comment Share on other sites More sharing options...
adap Posted February 3, 2010 Author Share Posted February 3, 2010 Thanks for the guidance. But once i change it. I only able to display table without data. Any solution? Quote Link to comment Share on other sites More sharing options...
gizmola Posted February 3, 2010 Share Posted February 3, 2010 If you have short tags off in the php.ini you can't use short tags -- so anyplace you used you need <?php. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.