|
Posted by The Legend on 06/17/05 17:38
solved this just a second ago watch the change in the html en sql code at
the alias part , i did not use alias signs from the original tables but used
original column names instead and did just the same in the html code
$sql = "SELECT scname,cname,bedrijfsnaam,plaats,website,omschrijving
FROM mb_advertentie,mb_categorie,mb_subcategorie
where mb_advertentie.cid =mb_categorie.id
and mb_advertentie.scid =mb_subcategorie.scid
and mb_advertentie.id = $id";
$result = mysql_query($sql);
while ($resultat = @mysql_fetch_array($result))
include "templates/tb_advertentie.php";
and html looks exactly like this:
<tr>
<tr bgcolor="<?php echo"$tabletop"; ?>">
<td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
?><?php echo"<b>$resultat[scname]</b>"; ?></td>
<td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
?><?php echo"<b>$resultat[cname]</b>"; ?></td>
<td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
?><?php echo"<b>$resultat[bedrijfsnaam]</b>"; ?></td>
<td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
?><?php echo"<b>$resultat[plaats]</b>"; ?>
<td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
?><?php echo"<b>$resultat[website]</b>"; ?>
</td><td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
?><?php echo"<b>$resultat[omschrijving]</b>"; ?>
</td>
I could remember something about [m.&] interpreted wrong by html or
processing code so after i left out the alias, the parsing was done.
The only thing i am worrying about is the concistency of the variables
parsed when i used this code without aliasing column/table names
"Joseph Melnick" <jmelnick@jphp.com> schreef in bericht
news:7OqdnVwHT-5MWC_fRVn-sg@rogers.com...
> Hello The Legend,
>
> How is $query set? If it is posted from a form or in the query string of a
> url or is it a cookie it is not evident here?
> Turn on errors and warnings
> Remove the @ in front of your function calls and you may notice that
> something is not being set.
>
> Joseph Melnick
> JM Web Conultants.
> http://www.jphp.com/
>
>
> "The Legend" <inavlid@invalid.com> wrote in message
> news:42b26e66$0$10548$e4fe514c@news.xs4all.nl...
>>
>> "J.O. Aho" <user@example.net> schreef in bericht
>> news:3hetlkFgs1v8U1@individual.net...
>>> The Legend wrote:
>>>
>>>> $sql = "SELECT m.naam,m.bedrijfsnaam,m.plaats,m.soort,m.titel,
>>>> FROM mb_advertentie m,mb_categorie c
>>>> where m.id=$query
>>>> and m.cid=c.id";
>>>> $result = mysql_query($sql);
>>>>
>>>> while ($resultat = @mysql_fetch_array($result))
>>>>
>>>> include "templates/b_advertentie.htm";
>>>> ?>
>>>> -----------------
>>>
>>> As we can't see how your templates/b_advertentie.htm we can't say what
>>> goes wrong (that file is included for each time there is a row in the
>>> mysql database).
>>>
>>> //Aho
>>
>>
>> hmm strange i did put that in my first post but here it is again:
>> -----
>> <tr>
>> <tr bgcolor="<?php echo"$tabletop"; ?>">
>> <td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
>> ?><?php echo"<b>$resultat[m.soort]</b>"; ?></td>
>> <td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
>> ?><?php echo"<b>$resultat[m.titel]</b>"; ?></td>
>> <td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
>> ?><?php echo"<b>$resultat[m.naam]</b>"; ?></td>
>> <td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
>> ?><?php echo"<b>$resultat[m.bedrijfsnaam]</b>"; ?>
>> <td><?php echo"<font face=$b_fontface size=$b_fontsize color=$Tlink>";
>> ?><?php echo"<b>$resultat[m.plaats]</b>"; ?>
>> </td>
>>
>> </tr>
>> ----
>>
>>
>> seems ok to me but no result is parsed into the html but when i do a
>> select
>> * from (1 table) parsing is there.
>>
>>
>> would be thankfull with any help on this
>>
>> gr,
>>
>> Ed
>>
>>
>
>
[Back to original message]
|