>Ahh. 'it doesn't work.'
>As in: it returns a error ? or doesn't display you what you want ?
Both. I've fiddled with it doing this and that and haven't been able to get
it to display correctly.
>> ----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 ?
Exactly what I'm trying to find out :-) I found in the book how to relate
two
tables that way, but I need four.
>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.
ok, I'll try that, thank you!
>> $sth->execute()
>> or bail_out("Can't get listings");
>Very informative.
The bail_out subroutine is the one that is in Paul DuBois' book "MySQL". It
displays the DBI error message.
>> 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) ?
Yes, it does a separate query.
>> 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 ?
>From when I was fiddling with it :-) That is going to display city, state
and zip (thus csz), but I changed something above that trying to get any
results from the query.
<snip>
Thanks!
Dawn
It's practically impossible to look at a penguin and feel angry. --Joe Moore
---------------------------------------------------------------------
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