Jump to content

Recommended Posts

So im testing and making an arcade system that MAY be included in the ezboards system. Im making a "GameInfo" Page and im testing things out and see if theres errors.

 

The problem is that the script is not picking up a certain from that ID. When I go to "domain.com/ViewGame?gid=34283", it doesn't pick up the gaming info from that ID in the mySQL.

 

Help anyone?

 

<?php
require('mysql.php');
mysql_select_db("ruko_fp", $con);

// Define the variables
$gid = $_GET['gid'];
$gametitle = $_GET['gametitle'];
$gamedescription = $_GET['gamedescription'];
$gamerating = $_GET['gamerating'];
$gamereview = $_GET['gamereview'];
$gameid = $_GET['gid'];
?>

TEST:

<h3><? $gametitle ?></h3> 

 

Heres what is displayed on a certain ID:

 

TEST:

 

<game title supposed to be here>

Link to comment
https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/
Share on other sites

You're not performing any checks on the database. You're trying to get all the information out of the URL with GET ...

 

You need to do a database query. The only thing you want to use GET for is to get the game ID out of the url...

 

sql="SELECT * FROM games WHERE gameid='$_GET['gameid']";

$result=mysql_query($sql, $con);

while ($row=mysql_fetch_array($result))

{

echo "Title: ".$row['gameTitle']."<br>";

echo "Genre: ".$row['genre']."<br>";

}

 

...etc

 

Parse error: syntax error, unexpected '=' in /home/ruko/public_html/ViewGame.php on line 4

<?php
require('mysql.php');
mysql_select_db("ruko_fp", $con);
sql="SELECT * FROM games WHERE gameid='$_GET['gameid']";
$result=mysql_query($sql, $con);
while ($row=mysql_fetch_array($result))
{
echo "Title: ".$row['gametitle']."<br>";
echo "Genre: ""; 
}

 

oh its fine mate :) I got a hold of it now :)

 

Scratch that, im currently writing my SQL code and now im getting confused. >.< It makes me wanna pull my hair out. Maybe someone can give me part of that code pls. I have a REALLY hard time writing out my codes properly.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.