On 10-Jun-01 Dawn H wrote:
> Here's what I currently have that doesn't work:
>
Ahh. 'it doesn't work.'
As in: it returns a error ? or doesn't display you what you want ?
> ----BEGIN QUOTE-----
> $sth=$dbh->prepare ("SELECT listing.id, pictures.thumb_1,
description.mls,
> listing.p_city, listing.p_state, listing.p_zip, description.price from
> listing, description, pictures");
And the tables are related how ? Shouldn't there be a WHERE a.id=b.id
somewhere in there ?
Also a good practice is:
$debug=1;
$qry="select ... from ... where ...";
print "\ndebug: $qry \n" if $debug;
$sth->prepare($qry);
Then cut-n-paste the debug output into the mysql client to make sure of the
results.
> $sth->execute()
> or bail_out("Can't get listings");
Very informative.
> print "<TABLE>";
> while (($id, $thumb, $mls, $p_city, $p_state, $p_zip, $price) =
> $sth->fetchrow_array())
> {
> print "<TR><TD>";
> show_thumb($id);
Does show_thumb() make another db query while you are looping on this
result-set ? Or did you mean show_thumb($thumb) ?
> print
> "</TD><TD><B>$mls</B></TD><TD><B>$csz</B></TD><TD><B>$price</B></TD></TR>";
>
> -----END QUOTE-----
Check your quoter, where did $csz come from ?
>
> The four tables are listing, description, rooms, and pictures. Each has an
> ID column that will be identical; however some will have null columns. I
> need the information out of each table for any one ID number regardless if
> the column contains info or not. Hope this is clear enough. I'm a beginner
> at MySQL (and related stuff) so your suggestion of ODBC went totally over my
> head ;-) Thanks!
>
<snip>
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php