Hi,
Here is another situation when I need the PHPBuilder’s experts help.
My health-related site is currently echoing news articles from one specific subject (arthritis). The table has about 100 rows with a few standard fields (ID, title, content… etc). It works fine as it is.
What I would like to do now is to echo not only from the arthritis table but also from two other tables (alzheimers and cancer). All the tables are in the same database. So that this random 5 articles will be coming not from one single table (arthritis) but from all three. Btw, all 3 tables have the same structure.
This is the current (simplified) code with only one table.
<?php
$hostname="myserver.net";
$username="myusername";
$password="mypass";
$dbname="mydb";
$usertable="arthritis";
mysql_connect($hostname,$username,$password) or die(mysql_error());
mysql_select_db("$dbname") or die(mysql_error());
$data = mysql_query("SELECT * FROM $usertable ORDER BY RAND() LIMIT 5")
or die(mysql_error()); while($info = mysql_fetch_array( $data ))
echo $info['title'];
echo "<br>";
echo $info['content'];
?>
Thanks in advance for your always kind and helpful responses.
Tim