Jump to content


Photo

how to echo from database


  • Please log in to reply
3 replies to this topic

#1 alarik149

alarik149
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 08 March 2006 - 11:58 AM

hi guys,I have a question.I see the internet is quite low on information on this matter or is just me that dosen`t know how to search.
So i have a database named championships that contains 2 fields 'username' and 'status'.I connect to the databse,it's all ok,but next i'm stuck.
How can I echo into a webpace all the usernames?and second how can I echo into a webpage only the usernames with the status "test".
thanks for your time
Tired of math homework ? Just visit http://www.solvemymath.com for a free online math solver and calculator.
Videochat bucuresti studio -> http://www.GirlAddicts.com
About the adult video chat business -> www.girlplan.com

#2 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 08 March 2006 - 12:05 PM

<?php
    $user="";
    $host="localhost";
    $password="";
    $database = "championships";
    mysql_connect($host,$user,$password);
    mysql_select_db($database);



echo "<table border='1'><tr><td>Username</td><td>Status</td></tr>";
$result = mysql_query("SELECT * from championships where status like 'test' order by username asc ");
while($row=mysql_fetch_array($result)){
     echo "<tr><td>".$row['username']."</td><td>".$row['status']."</td></tr>";
     }
echo </table>
?>


#3 alarik149

alarik149
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 08 March 2006 - 12:16 PM

:) thanks a lot,it worked:).with some little change in the code:).big thanks.I am amazed how helpful you guys are..
Tired of math homework ? Just visit http://www.solvemymath.com for a free online math solver and calculator.
Videochat bucuresti studio -> http://www.GirlAddicts.com
About the adult video chat business -> www.girlplan.com

#4 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 08 March 2006 - 12:19 PM

Yea, and all the REALLY smart people aren't even online yet! (No offence if you smart guys are lurking about LOL)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users