Hey everyone
I could use some help here
I have successfully entered an article into my mysql DB
I would like to be able to view last post, as well as list all articles as well
should I be doing this as a mysql_num_rows
or what command should I use
please help very important
here is what im using
mysql_connect($db_host, $db_user, $db_pass)
or die("Could not connect: " . mysql_error());
mysql_select_db($db_base)or die("Could not connect to table: " . mysql_error());
$query = "SELECT subject FROM $table_name WHERE user_id = '1'";
#SELECT id FROM users WHERE name = 'pete'
$query_result_handle = mysql_query ($query)
or die ('The query failed! $table_name must be a valid table name that exists in the database specified in mysql_select_db');
$results = mysql_query($query);
$results_array = mysql_fetch_row($results);
foreach($results_array as $i => $data) {
if ($i == "1") {
echo "<a href='article.php'>$i: $data\n";
}
else {
echo "<a href='article.php'>$i: $data\n";
}
}
mysql_close();?>
---Aaron---
www.youngcanadian.com