posted here before
need some help on a SQL datbase scipt help
i am looking to build a scipt that can read form 2 db's at the same time for example
it will print:
(data from db1)
(data from db2)
(data from db1)
(data from db2)
and so on till there is no data left
but every time i try to do this i end up with it starting with one output of db1 and then printing all of db2 then the rest of db1 i know why it is doing that but i dont want it to
so i need some help so as to how to get it to sopt the loop mid way and continue db1
example:
db1
db2
db2
db2
db1
db1
heres the scipt that im useing
<?
$conn = mysql_connect("localhost", "user", "inserthere");
mysql_select_db("test",$conn);
$sql = "SELECT * FROM jorunal ORDER BY id DESC";
$result = mysql_query($sql, $conn) or die(mysql_error());
while($newArray = mysql_fetch_array($result)){
$testField = $newArray['journal'];
echo "<p align=\"left\">comment:<br>$testField<br></p>";
}
?>
if it help im useing it as an include on another page
is there some way i can use a counter of some sort or somthing?
longobw