iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-30-2005, 02:39 PM
WebProWorld New Member
 
Join Date: Feb 2005
Location: Brussels
Posts: 12
Any Who RepRank 0
Default Ask for help with php program

Next php code is being included in a table on a link page. For each category there is a script like this one. But it gives an error for the last php tag. can anybody tell me what's wrong?

<?
$verbinding=mysql_connect("localhost", "phpgebruiker", "php");
mysql_select_db("webleren");
$query = "SELECT sitenaam, url FROM linkpagina WHERE categorie=='science fiction';
$resultaat = mysql_query($query);
while ($T_string) {
$T_string = mysql_fetch_assoc($resultaat);
print $T_string($sitenaam);
$T_string = mysql_fetch_assoc($resultaat);
}?>


<?
mysql_free_result($resultaat);
mysql_close($verbinding);
?>
Reply With Quote
  #2 (permalink)  
Old 03-31-2005, 08:26 AM
WebProWorld Member
 
Join Date: Nov 2004
Posts: 33
imported__sam_ RepRank 0
Default Re: Ask for help with php program

Quote:
Originally Posted by Any Who
$query = "SELECT sitenaam, url FROM linkpagina WHERE categorie=='science fiction';
Missing " here

Quote:
Originally Posted by Any Who
print $T_string($sitenaam);
That should be:
print $T_string['sitenaam'];

And I hope you are aware that this loop prints only every second row and you will have to work on the formating of the ourput.

best regards

- Sam
__________________
Software-Pointers.com - Directory of Software Development Sites - Free submission.
Reply With Quote
  #3 (permalink)  
Old 03-31-2005, 08:27 AM
WebProWorld Member
 
Join Date: Nov 2004
Posts: 33
imported__sam_ RepRank 0
Default Re: Ask for help with php program

Quote:
Originally Posted by Any Who
$query = "SELECT sitenaam, url FROM linkpagina WHERE categorie=='science fiction';
Missing " here

Quote:
Originally Posted by Any Who
print $T_string($sitenaam);
That should be:
print $T_string['sitenaam'];

And I hope you are aware that this loop prints only every second row and you will have to work on the formating of the output.

best regards

- Sam
__________________
Software-Pointers.com - Directory of Software Development Sites - Free submission.
Reply With Quote
  #4 (permalink)  
Old 04-03-2005, 07:13 PM
WebProWorld Pro
 
Join Date: Feb 2004
Location: England Baby!
Posts: 216
icb01co2 RepRank 0
Default

Looks a bit strange to me, i havent tested this but maybe:



<?
$verbinding=mysql_connect("localhost", "phpgebruiker", "php");
mysql_select_db("webleren");


$query = "SELECT sitenaam, url FROM linkpagina WHERE categorie='science fiction'";

$result = mysql_query($query, $verbinding);

if ($myrow = mysql_fetch_array($result)) {
do
{
$Sitenaam = $myrow['sitenaam'];
echo $Sitenaam;
}while($myrow = mysql_fetch_array($result));
}

?>


Not sure though as im a little unsure what you were trying to do.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:50 AM.



Search Engine Optimization by vBSEO 3.3.0