Ruko Posted April 17, 2010 Share Posted April 17, 2010 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> Quote Link to comment https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 17, 2010 Share Posted April 17, 2010 What mySQL?? Quote Link to comment https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/#findComment-1043510 Share on other sites More sharing options...
Jax2 Posted April 17, 2010 Share Posted April 17, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/#findComment-1043511 Share on other sites More sharing options...
Ruko Posted April 17, 2010 Author Share Posted April 17, 2010 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: ""; } Quote Link to comment https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/#findComment-1043514 Share on other sites More sharing options...
Jax2 Posted April 17, 2010 Share Posted April 17, 2010 Sorry, I just wrote the code out fast for you, I wasn't expecting you to actually use it lol You'll need to write your own query with your own database field names in it ... I was just giving you an example ... Quote Link to comment https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/#findComment-1043554 Share on other sites More sharing options...
Ruko Posted April 17, 2010 Author Share Posted April 17, 2010 oh its fine m8 I got a hold of it now Quote Link to comment https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/#findComment-1043572 Share on other sites More sharing options...
Ruko Posted April 17, 2010 Author Share Posted April 17, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/#findComment-1043578 Share on other sites More sharing options...
Ruko Posted April 17, 2010 Author Share Posted April 17, 2010 bump Quote Link to comment https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/#findComment-1043782 Share on other sites More sharing options...
Ruko Posted April 17, 2010 Author Share Posted April 17, 2010 nvm I got it figured out. solved. Quote Link to comment https://forums.phpfreaks.com/topic/198816-php-script-not-collecting-mysql-info/#findComment-1043872 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.