Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-01-2002, 07:32 PM   PM User | #1
The69Pimp
New Coder

 
Join Date: Jun 2002
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
The69Pimp is an unknown quantity at this point
Unhappy Help Me Please

i am starting a gaming website and i am having a bit of a problem with them here is my first pahe index.php
PHP Code:
<html>
<head><title>Web Database Sample Index</title>
</head> 

<body bgcolor=#ffffff>
<h1>Data from tabletest</h1>
<?
    mysql_connect
("localhost""*****""*****");
    
$query "SELECT GameName,
Sub_date,
Dev_email,
Stage,
Genre,
Client,
Platform,
Interface,
Multiplayer,
Prizes,
Last_reviewed,Cost,
ESRBRating,
Game_URL FROM gameform"
;
    
$result mysql_db_query("*****"$query); 

    if (
$result) {
        echo 
"Found these entries in the database:<ul>";
        while (
$r mysql_fetch_array($result)) {
            
$GameName $r["Game Name"];
$Sub_date $r["Submission Date"];
$Dev_email $r["Developers Email"];
$Stage $r["Development Stage"];
$Genre $r["Game Genre"];
$Client $r["Client"];
$Platform $r["Platform"];
$Interface $r["Interface"];
$Multiplayer $r["Multiplayer"];
$Prizes $r["Prizes"];
$Last_reviewed $r["Last Reviewed"];
$Cost $r["Game Cost"];
$ESRBRating $r["ESRBRating"];
$Game_URL $r["Game URL"];
            echo 
"<li>$GameName, 
$Sub_date, 
$Dev_email, 
$Stage, $Genre, 
$Client, 
$Platform, 
$Interface, 
$Multiplayer, 
$Prizes, $Last_reviewed, 
$Cost, 
$ESRBRating, 
$Game_URL"
;
        }
        echo 
"</ul>";
    } else {
        echo 
"No data.";
    }
    
mysql_free_result($result);
?>

<form name="form1" method="post" action="add_new_game.php">
  <input type="submit" name="Submit" value="Add A New Game">
</form>
<p>&nbsp; 
</body>
</html>

Last edited by The69Pimp; 07-01-2002 at 07:42 PM..
The69Pimp is offline   Reply With Quote
Old 07-01-2002, 07:34 PM   PM User | #2
The69Pimp
New Coder

 
Join Date: Jun 2002
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
The69Pimp is an unknown quantity at this point
and.....

here is the second page were they fillin the game info
PHP Code:
<html>
<head><title>Submitting New Game</title>
</head> 

<body bgcolor=#ffffff>
<?
    
if (isset($GameName
&& isset(
$Sub_date
&& isset(
$Dev_email
&& isset(
$Stage
&& isset(
$Genre
&& isset(
$Client
&& isset(
$Platform
&& isset(
$Interface
&& isset(
$Multiplayer
&& isset(
$Prizes
&& isset(
$Last_reviewed
&& isset(
$Cost
&& isset(
$ESRBRating
&& isset(
$Game_URL)) {
    
mysql_connect("localhost""*****""*****"); 
        
$query "INSERT INTO gameform VALUES 
('$GameName',
'$Sub_date',
'$Dev_email',
'$Stage',
'$Genre',
'$Client',
'$Platform',
'$Interface',
'$Multiplayer',
'$Prizes',
'$Last_reviewed',
'$Cost',
'$ESRBRating',
'$Game_URL')"
;
        
$result mysql_db_query("*****"$query); 

    if (
$result) {
        echo 
"<p>$name was added to the database</p>";
    }
}
?>

<h1>Add an entry</h1>
<form>
Game Name: <input type=text name='GameName'><br>
Submission Date: <input type=text name='Sub_date'><br>
Developers Email: <input type=text name='Dev_email'><br>
Development Stage: <input type=text name='Stage'><br>
Game Genre: <input type=text name='Genre'><br>
Client Type: <input type=text name='Client'><br>
Platform: <input type=text name='Platform'><br>
Interface: <input type=text name='Interface'><br>
Multiplayer: <input type=text name='Multiplayer'><br>
Prizes: <input type=text name='Prizes'><br>
Last Reviewed: <input type=text name='Last_reviewed'><br>
Cost: <input type=text name='Cost'><br>
ESRBRating: <input type=text name='ESRBRating'><br>
Game URL: <input type=text name='Game_URL'><br>
<input type=submit>
</form>

<form name="form2" method="post" action="index.php">
  <input type="submit" name="Submit" value="Return To Index">
</form>
</body>
</html>
and all it does when i click submit is it puts the info into the address bar please help me

Last edited by The69Pimp; 07-01-2002 at 07:46 PM..
The69Pimp is offline   Reply With Quote
Old 07-01-2002, 11:31 PM   PM User | #3
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,234
Thanks: 4
Thanked 81 Times in 80 Posts
Spookster will become famous soon enough
Which submit button?
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 07-02-2002, 04:23 AM   PM User | #4
The69Pimp
New Coder

 
Join Date: Jun 2002
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
The69Pimp is an unknown quantity at this point
the submit button after i fill in the info for the game
The69Pimp is offline   Reply With Quote
Old 07-02-2002, 05:56 AM   PM User | #5
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,234
Thanks: 4
Thanked 81 Times in 80 Posts
Spookster will become famous soon enough
This submit button?

<input type="submit" name="Submit" value="Add A New Game">
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 07-02-2002, 06:48 AM   PM User | #6
The69Pimp
New Coder

 
Join Date: Jun 2002
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
The69Pimp is an unknown quantity at this point
no the submit button got left out i belive the submit button it but here it is

PHP Code:
<input type=submit
that is in there i am new to php and mysql so i have no clue what to do to get it working
The69Pimp is offline   Reply With Quote
Old 07-02-2002, 09:47 AM   PM User | #7
Jeewhizz
Regular Coder


 
Join Date: May 2002
Location: London, England
Posts: 369
Thanks: 0
Thanked 0 Times in 0 Posts
Jeewhizz is an unknown quantity at this point
Its because you haven't specified a form method. change

<form>

to

<form name="form" method="post" action="wherever.php">

Jee
__________________
Jeewhizz - MySQL Moderator
http://www.sitehq.co.uk
PHP and MySQL Hosting
Jeewhizz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:33 AM.


Advertisement
Log in to turn off these ads.