What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » php/mysql review database

php/mysql review database
Author: Message:
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. RE: php/mysql review database
here is the code i have but its not actually submitting anything to the database (ive excluded names of db and password for security reasons)
[/code]<?
//initilize PHP

if($_POST['submit']) //If submit is hit
{
   //then connect as user
   //change user and password to your mySQL name and password
   mysql_connect("localhost","******_*****","********");

   //select which database you want to edit
   mysql_select_db("******_reviews");

   //convert all the posts to variables:
   $Title = $_POST['Title'];
   $Platform = $_POST['Platform'];
   $Review = $_POST['Review'];
   $Reviewer = $_POST['Reviewer'];
   $Rating = $_POST['Rating'];
   $Date = $_POST['Date'];
   
   //Insert the values into the correct database with the right fields
   //mysql table = database
   //table columns = Title, Platform, Review, Reviewer, Rating, Date
   //post variables = $Title, $Platform, '$Review, $Reviewer, $Rating, $Date
   $result=MYSQL_QUERY("INSERT INTO database (Title,Platform,Review,Reviewer,Rating,Date)".
      "VALUES ('$Title', '$Platform', '$Review', '$Reviewer', '$Rating', '$date')");

    //confirm
   echo "Review uploaded succesfully!";
}

else
{
// close php so we can put in our code
?><title>GameSmart - Write your own game reviews!!</title>
<style type="text/css">
<!--
.style1 {color: #666666}
-->
</style>

<form action="uploadreview.php" method="post" class="style1">
<TABLE>
<TR>
   <TD align="center" valign="top">Title:</TD>
   <TD><INPUT TYPE='TEXT' NAME='Title' VALUE='' size=60></TD>
</TR>
<TR>
   <TD align="center" valign="top">Platform:</TD>
   <TD>
    <SELECT NAME='Platform'>
    <OPTION VALUE='PS2'>PS2
    <OPTION VALUE='Gamecube'>Gamecube
    <OPTION VALUE='XBOX'>XBOX
    <OPTION VALUE='PC'>PC
    <OPTION VALUE='GBA'>GBA
    </SELECT></TD>
</TR><br>
<TR>
   <TD align="center" valign="top">Review:</TD>
   <TD><textarea name="Review" cols="60" rows="20"></textarea></TD>
</TR>
<TR>
  <TD align="center" valign="top">Rating:</TD>
  <TD><input name='Rating' type='TEXT' size=3 maxlength="2">
    /10</TD>
</TR>
<TR>
  <TD align="center" valign="top">Reviewer:</TD>
  <TD><INPUT NAME='Reviewer' TYPE='TEXT' size=60 maxlength="30"></TD>
</TR>
<TR>
   <TD align="center" valign="top">Date:</TD>
   <TD><INPUT TYPE='text' NAME='Date' VALUE='<? echo date("M.j.y"); ?>' size=60></TD>
</TR>
<TR>
   <TD></TD><br>
   <TD><INPUT TYPE="submit" name="submit" value="submit"></TD>
</TR>
</TABLE>
</form>

<?
} //close the else statement
?>[/code]
can anybody see whats wrong with this code?

This post was edited on 08-08-2004 at 04:07 PM by Eljay.
08-08-2004 04:02 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
php/mysql review database - by Eljay on 08-07-2004 at 02:30 PM
RE: php/mysql review database - by Concord Dawn on 08-07-2004 at 03:40 PM
RE: php/mysql review database - by Eljay on 08-08-2004 at 09:00 AM
RE: php/mysql review database - by WDZ on 08-08-2004 at 09:17 AM
RE: php/mysql review database - by Eljay on 08-08-2004 at 09:39 AM
RE: php/mysql review database - by musicalmidget on 08-08-2004 at 10:39 AM
RE: php/mysql review database - by Eljay on 08-08-2004 at 12:20 PM
RE: php/mysql review database - by bach_m on 08-08-2004 at 03:20 PM
RE: php/mysql review database - by Eljay on 08-08-2004 at 04:02 PM
RE: php/mysql review database - by bach_m on 08-08-2004 at 05:36 PM
RE: php/mysql review database - by Eljay on 08-08-2004 at 05:43 PM
RE: php/mysql review database - by bach_m on 08-08-2004 at 06:04 PM
RE: php/mysql review database - by Eljay on 08-08-2004 at 06:16 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On