san_cash Posted December 11, 2009 Share Posted December 11, 2009 sir can anyone please help me as i am a beginner in putting the data in html format. the script looks like the following. i want the data to be inside the table and it should go to the next page when data crosses 20. <?php include("connect.php"); $query="SELECT * FROM company "; $result=mysql_query($query); $num = mysql_num_rows ($result); mysql_close(); if ($num > 0 ) { $i=0; while ($i < $num) { $name_ = mysql_result($result,$i,"name_"); $address = mysql_result($result,$i,"address"); $telephone = mysql_result($result,$i,"telephone"); $email = mysql_result($result,$i,"email"); $company = mysql_result($result,$i,"company"); $id = mysql_result($result,$i,"id"); echo "<b>ID :</b> $id<br>"; echo "<b>Name :</b> $name_<br>"; echo "<b>Address:</b> $address<br>"; echo "<b>Telephone:</b> $telephone<br>"; echo "<b>Email:</b> $email<br>"; echo "<b>Company:</b> $company<br>"; echo "<a href=\"update.php?id=$id\">Update</a> - <a href=\"delete.php?id=$id\">Delete</a>"; echo "<br><br>"; ++$i; } } else { echo "The database is empty"; } ?> thanks in advance Santosh Link to comment https://forums.phpfreaks.com/topic/184762-data-inside-table-php/ Share on other sites More sharing options...
cags Posted December 11, 2009 Share Posted December 11, 2009 a.) This is a duplicate post, but I guess it's at least in the right place this time. b.) Use code tags. c.) Getting it in a table and pagination are two separate issues that will need to be addressed separately. Formatting the data into a table is the easier part but can only really be addressed once you have sorted out the pagination. A good place to start on pagination would be the tutorial right here on the site. Link to comment https://forums.phpfreaks.com/topic/184762-data-inside-table-php/#findComment-975367 Share on other sites More sharing options...
san_cash Posted December 12, 2009 Author Share Posted December 12, 2009 duplicate post ? I dint understand Cheers Santosh Link to comment https://forums.phpfreaks.com/topic/184762-data-inside-table-php/#findComment-975794 Share on other sites More sharing options...
blueman378 Posted December 12, 2009 Share Posted December 12, 2009 duplicate post ? I dint understand Cheers Santosh you didn't spell properly either. Duplicate post is when you post the same topic more than once. Link to comment https://forums.phpfreaks.com/topic/184762-data-inside-table-php/#findComment-975833 Share on other sites More sharing options...
cags Posted December 12, 2009 Share Posted December 12, 2009 You also posted this thread... http://www.phpfreaks.com/forums/index.php/topic,280263.msg1327477.html#msg1327477 ... which is exactly the same. Link to comment https://forums.phpfreaks.com/topic/184762-data-inside-table-php/#findComment-975909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.