|
-
Sep 5th, 2002, 01:31 PM
#1
Thread Starter
Hyperactive Member
*Solved My Self* thanks for the help >_<
Ok, i want to know how to do a get from the database its my sql, I know how to do a simple one
PHP Code:
<?php
include("header.php");
mysql_connect( "my host >_<", "blah", "blah" );
mysql_select_db( "test" );
$rsResult = mysql_query( "SELECT id, username, saying FROM test;" );
echo "<center><b>Members</b></center><p><ul>";
while( list( $id, $username, $saying ) = mysql_fetch_row( $rsResult ) ){
echo "<li>$id- $username says: $saying</li>";
}
echo "</ul>";
include("footer.php");
?>
All of that works, but now i want to put something in the footer, (I.E. add more variables, but only from one row in the database) right now, that code gets all the rows in the database, and thats fine, but i want to know how to only get one row from the databse in my footer... Any help?
Last edited by flame_211; Sep 5th, 2002 at 02:32 PM.
-
Sep 5th, 2002, 02:33 PM
#2
PowerPoster
execute the query again but with a WHERE clause specifying which row you want
Or, during that while loop, when you get to the row you want, store the values in some variables for use later on in the footer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|