Hi Guys,
I got the multiple inserts working now i'm having problems with displaying it, that is data from the two tables on the one php page. I 've tried to use JOIN and INNER JOIN to no avail.
Both tables have CatID. CatID in the "$table" is auto_increment and primary key. The CatID in the "pref" table is my relation to the "$table" table.
These values are from the "pref" table:
$pref = $links["pref"];
$pref_email = $links["pref_email"];
$expiry_date = $links["expiry_date"];
$pref_memo = $links["pref_memo"];
Here is my code:
<?php
include ("include/header.inc.php");
include ("include/dbconnect.php");
if ($id) {
$result = mysql_query("SELECT * FROM $table WHERE CatID=$id",$db);
$links = mysql_fetch_array($result);
$id = $links["CatID"];
$firstname = $links["CatParent"];
$lastname = $links["CatName"];
$address = $links["address"];
$suburb = $links["suburb"];
$state = $links["state"];
$post_code = $links["post_code"];
$phone = $links["phone"];
$Info = $links["Info"];
$urls = explode(", ", $links[url]);
$picture = $links["picture"];
$map_ref = $links["map_ref"];
$map_pic_thumb = $links["map_pic_thumb"];
$map_pic_detail = $links["map_pic_detail"];
$pref = $links["pref"];
$pref_email = $links["pref_email"];
$expiry_date = $links["expiry_date"];
$pref_memo = $links["pref_memo"];
echo "<b><u>$lastname</u></b>: <br><br>";
echo "<b>Address:</b> $address <br>";
#echo "<b>Telephone numbers:</b><br>";
echo "<b>Suburb:</b> $suburb<br>";
echo "<b>State:</b> $state<br>";
echo "<b>Post Code:</b> $post_code<br><br>";
echo "<b>Phone:</b> $phone<br><br>";
echo "<b>Info:</b> $Info<br><br>";
//if ( $row['url'] != "" ) {
//$urls = explode(", ", $row[url]);
for ($i = 0; $i < count($urls); $i++) {
echo "<b>URL:</b> <a href=$urls[$i] target=\"_blank\">$urls[$i]</a><br><br>";
}
echo "<b>Picture:</b> $picture<br><br>";
echo "<b>Map Ref:</b> $map_ref<br><br>";
echo "<b>Map Pic Thumb:</b> $map_pic_thumb<br><br>";
echo "<b>Map Pic Detail:</b> $map_pic_detail<br><br>";
echo "<b>Preferential No.:</b> $pref<br><br>";
echo "<b>Preferential (Email):</b> $pref_email<br><br>";
echo "<b>Preferential: (Expiry Date):</b> $expiry_date<br><br>";
echo "<b>Preferential (Memo):</b> $pref_memo<br><br>";
}
?>