renfley Posted January 25, 2010 Share Posted January 25, 2010 K i have a very noobish question , i have 5 item in my database id,callsign,email,location,joindate and i wnt to display them on my page, now i m at a loss i havnt done this in years and any help would be apreciated. so far ive got <?PHP mysql_connect("localhost","root","root"); mysql_select_db("RankingSystem"); $result = mysql_query("select * from rank_tbl"); ?> Link to comment https://forums.phpfreaks.com/topic/189693-display-php-in-web-page/ Share on other sites More sharing options...
tinkertron Posted January 25, 2010 Share Posted January 25, 2010 I would love to show you how, but time is limited. But I can tell you how I did mine, if you don't mine doing alittle reading. Goto http://www.w3schools.com/php/php_mysql_intro.asp But here is what I cut and paste from the site: <?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM Persons"); echo "<table border='1'> <tr> <th>Firstname</th> <th>Lastname</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['LastName'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> Now this is an example, you'll have to read the code and add or delete what you need. But I would suggest to try the site and learn from their examples and you'll get the hang of it, if you done it before. Cheers! Link to comment https://forums.phpfreaks.com/topic/189693-display-php-in-web-page/#findComment-1001125 Share on other sites More sharing options...
renfley Posted January 25, 2010 Author Share Posted January 25, 2010 Genious pure genious lol i must have missed it on w3c thanks for that BTW!!!! Link to comment https://forums.phpfreaks.com/topic/189693-display-php-in-web-page/#findComment-1001130 Share on other sites More sharing options...
tinkertron Posted January 25, 2010 Share Posted January 25, 2010 Your very welcome! I hope you all the luck in the world! Peace! If this has resolved your issues, please mark post as RESOLVED! Link to comment https://forums.phpfreaks.com/topic/189693-display-php-in-web-page/#findComment-1001144 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.