Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox 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.

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: 11
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: 32
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: 32
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: 222
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
Tags: , , ,



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

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


Search Engine Optimization by vBSEO 3.2.0