For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > June 2004 > ummm i am confused









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ummm i am confused
Water_foul

2004-06-26, 3:55 pm

i get the following error:
Parse error: parse error, unexpected ';' in
C:\Inetpub\localroot\aichlmayr. net\sites\aaron\module\runescape\runerun
ner\s
ervices.php on line 4
from the following code:
<?php
//Database Querys
$dbconn = mysql_connect($dbHost , $dbName , $dbPassword)
or die("Could not connect to server, incorrect username,
password or host : ".mysql_error();
$connection=Mysql_connect($dbHost , $dbName , $dbPassword)
//function zone

//creates table
function tablecreate($num,$connection){
$items=mysql_query('SELECT Row_Decription, Required_Items, Misc FROM
RuneRunner WHERE ID = $num',$connection);
$item=mysql_fetch_array($items);
$users1=mysql_query('SELECT RuneRunner.rune, RuneRunnerprices.price FROM
RuneRunner INNER JOIN RuneRunnerprices ON RuneRunner.User_Id =
RuneRunnerprices.User_Id WHERE RuneRunnerprices.ID = $num AND
RuneRunnerPrices.user_id = 1',$connection);
$user1=mysql_fetch_array($users1);
$users2=mysql_query('SELECT RuneRunner.rune, RuneRunnerprices.price FROM
RuneRunner INNER JOIN RuneRunnerprices ON RuneRunner.User_Id =
RuneRunnerprices.User_Id WHERE RuneRunnerprices.ID = $num AND
RuneRunnerPrices.user_id = 2',$connection);
$user2=mysql_fetch_array($users2);
print ('<tr><td>' . $item[1] . '</td><td><img
src=module/runescape/Runerunner/' . $user1[1] . '.gif>' . $user1[2].
'<br><img src=module/runescape/Runerunner/' . $user2[1] . '.gif>' .
$user2[2]. '</td><td>' . $item[2] . '</td></tr>');
};

//this function is called by another
function picscreate($Rune,$username,$num){
print('<img src=module/runescape/Runerunner/' . $Rune . '.gif>' . $username
.. '<br>');
${'' . $num . ''}=$Rune;
};

//gets data form database and sends it to pics()
Function picspprep($usernum,$connection){
$pict=mysql_query('SELECT username,rune FROM RuneRunner WHERE User_ID =
$usernum',$connection);
$pic=mysql_fetch_array($pict);
picscreate($pic[1],$pic[2],$usernum);
};
?>
<i><u><b>Welcome to the RuneRunners Runescape service page</b></u></i><br>
<i>The currrent Runerunners are:<br>
<!--begin Database Data-->
<?php
picspprep(1,$connection);
picspprep(2,$connection);
?>
<!--end Database Data-->
<hr>
To order a service, click on the running rune below that matches the one on
the player you want to buy from above
</i>
<table cellspacing="2" cellpadding="2" border="1">
<tr>
<td>Service</td>
<td>Prices</td>
<td>Required Items</td>
</tr>
<!--loop database data to create table-->
<?php
$id=1;
while($id<=296){
tablecreate($id,$connection);
$id=$id+1;
};
?>
<!-- end loop -->
</table>
Torsten Roehr

2004-06-26, 3:55 pm

"Water_foul" <phpdbnews@aaron.aichlmayr.net> wrote in message
news:20040626152304.81242.qmail@pb1.pair.com...
> i get the following error:
> Parse error: parse error, unexpected ';' in
>

C:\Inetpub\localroot\aichlmayr. net\sites\aaron\module\runescape\runerun
ner\s
> ervices.php on line 4
> from the following code:
> <?php
> file://Database Querys
> $dbconn = mysql_connect($dbHost , $dbName , $dbPassword)
> or die("Could not connect to server, incorrect username,
> password or host : ".mysql_error();
> $connection=Mysql_connect($dbHost , $dbName , $dbPassword)


You are missing a ; on the above line. PHP even told you on what line the
error occurred. You do not have to post all of your code if the error occurs
on line 4. And please choose a better subject for your posts.

Regards, Torsten Roehr
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com