Saturday, October 24, 2009

Help: With simple recalling database data usinng php...

Posted on 10:19 AM by programlover









<?php

$user = 'myusername';

$pass = 'mypassword';

$host = 'localhost';

$db = 'mountgam_Gametab';



@mysql_connect($host,$user,$pass) or die ('Fail');

@mysql_select_db($db) or die ('Fail2');



$query = ("SELECT id FROM Gamepage") or die ('Fail3');



echo $query or die('Fail4');





?>



I can't get that to work. -Or any other solution on youtube, can someone please help me?

EDIT: it just comes up with a '1' =/

-It should come up with the id from the Gamepage which is Test1 and Test2 (2 records)



-Username is right, password is right, database is right, table is right, and 'id' is a field in the table.



Thanks...