Re: ummm i am confused
| From: | water_foul | Date: | Sat, 26 Jun 2004 15:27:24 +0000 |
| Subject: | Re: ummm i am confused | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34987@lists.php.net to get a copy of this message | ||
oh... duh why didn't i see that
"Mikhail U. Petrov" <mikhail@begun.ru> wrote in message
news:131111667208.20040626192944@begun.ru...
> Hi!
> Insert one more bracket!
> <?php
> //Database Querys
> $dbconn = mysql_connect($dbHost , $dbName , $dbPassword)
> or die("Could not connect to server, incorrect username,
> password or host : ".mysql_error()); <-this bracket!!!
> $connection=Mysql_connect($dbHost , $dbName , $dbPassword)
>
>
>
> Saturday, June 26, 2004, 7:23:30 PM, water_foul wrote:
>
> w> i get the following error:
> w> Parse error: parse error, unexpected ';' in
> w>
C:\Inetpub\localroot\aichlmayr.net\sites\aaron\module\runescape\runerunner\s
> w> ervices.php on line 4
> w> from the following code:
> w> <?php
> w> //Database Querys
> w> $dbconn = mysql_connect($dbHost , $dbName , $dbPassword)
> w> or die("Could not connect to server, incorrect username,
> w> password or host : ".mysql_error();
> w> $connection=Mysql_connect($dbHost , $dbName , $dbPassword)
> w> //function zone
>
> w> //creates table
> w> function tablecreate($num,$connection){
> w> $items=mysql_query('SELECT Row_Decription, Required_Items, Misc
FROM
> w> RuneRunner WHERE ID = $num',$connection);
> w> $item=mysql_fetch_array($items);
> w> $users1=mysql_query('SELECT RuneRunner.rune, RuneRunnerprices.price
FROM
> w> RuneRunner INNER JOIN RuneRunnerprices ON RuneRunner.User_Id =
> w> RuneRunnerprices.User_Id WHERE RuneRunnerprices.ID = $num AND
> w> RuneRunnerPrices.user_id = 1',$connection);
> w> $user1=mysql_fetch_array($users1);
> w> $users2=mysql_query('SELECT RuneRunner.rune, RuneRunnerprices.price
FROM
> w> RuneRunner INNER JOIN RuneRunnerprices ON RuneRunner.User_Id =
> w> RuneRunnerprices.User_Id WHERE RuneRunnerprices.ID = $num AND
> w> RuneRunnerPrices.user_id = 2',$connection);
> w> $user2=mysql_fetch_array($users2);
> w> print ('<tr><td>' . $item[1] . '</td><td><img
> w> src=module/runescape/Runerunner/' . $user1[1] . '.gif>' . $user1[2].
> w> '<br><img src=module/runescape/Runerunner/' . $user2[1] .
> w> '.gif>' .
> w> $user2[2]. '</td><td>' . $item[2] .
> w> '</td></tr>');
> w> };
>
> w> //this function is called by another
> w> function picscreate($Rune,$username,$num){
> w> print('<img src=module/runescape/Runerunner/' . $Rune . '.gif>'
> w> .
$username
> w> . '<br>');
> w> ${'' . $num . ''}=$Rune;
> w> };
>
> w> //gets data form database and sends it to pics()
> w> Function picspprep($usernum,$connection){
> w> $pict=mysql_query('SELECT username,rune FROM RuneRunner WHERE User_ID =
> w> $usernum',$connection);
> w> $pic=mysql_fetch_array($pict);
> w> picscreate($pic[1],$pic[2],$usernum);
> w> };
> ?>>
> w> <i><u><b>Welcome to the RuneRunners Runescape service
page</b></u></i><br>
> w> <i>The currrent Runerunners are:<br>
> w> <!--begin Database Data-->
> w> <?php
> w> picspprep(1,$connection);
> w> picspprep(2,$connection);
> ?>>
> w> <!--end Database Data-->
> w> <hr>
> w> To order a service, click on the running rune below that matches the
one on
> w> the player you want to buy from above
> w> </i>
> w> <table cellspacing="2" cellpadding="2" border="1">
> w> <tr>
> w> <td>Service</td>
> w> <td>Prices</td>
> w> <td>Required Items</td>
> w> </tr>
> w> <!--loop database data to create table-->
> w> <?php
> w> $id=1;
> w> while($id<=296){
> w> tablecreate($id,$connection);
> w> $id=$id+1;
> w> };
> ?>>
> w> <!-- end loop -->
> w> </table>
>
>
>
> --
> Best regards,
> Mikhail U. Petrov
> mailto:mikhail@begun.ru