getting all data echo´d out from database
Posted: Thu Jan 21, 2010 10:59 am
Hi I was wondering how do u echo out all of the containt of the database.
I got a simple code where i get a users id "unique number for everyone" and what i would like to get is so that when i:
now where it sais echo "$All Of The Database" there i want it to echo out all that is within the database where id is id.
I got a simple code where i get a users id "unique number for everyone" and what i would like to get is so that when i:
Code: Select all
<html>
<head>
<title>Two By Two Game</title>
</head>
<body bgcolor="#A4A8B0">
<center><h1>Users</h1>
<?php
include "../login/database.php";
$users =(isset($_GET['users'])) ? (int)$_GET['users'] : false;
if($users !== false)
{
$sqls="SELECT * FROM konto WHERE saved_id=$users"; //selecting all from DB "Konto" where saved_id is the same as in the array $id
}
else
{
echo "NO saved_id!"."<br>";
}
$results = mysql_query($sqls) or die("Kunde inte lägga till ny text:<br />" . mysql_error());//Skicka info till tabell.
while($rows = mysql_fetch_array( $results )) //fetching info from file and putting it in $row
{
echo $All Of The Database."<br>";
}
?>
</body>
</html>