Jump to content

[SOLVED] Please help i cant find the error


DrTrans

Recommended Posts


<?php


$fname = $_GET['fname'];
$lname = $_GET['lname'];
$slname = $_GET['slname'];
$submit = $_GET['submit'];
$title  = $_GET['title'];
$region = $_GET['region'];
$key = $_GET['key'];
$skey = $_GET['skey'];
$date = date("F j, Y, g:i a");

     
if($title){
 echo "$title";
 $connect = mysql_connect("localhost","damgears_evil","damgears");
     mysql_select_db("damgears_evil");
     $queryb = mysql_query("INSERT INTO titles VALUES ('','$fname','$lname','$key','$slname','$skey','$date','$title','$region'");
   } else 
   echo"Problem.. Check Database";
?>

I dont understand why its not inserting the line in the database.

you're not telling the query where to insert those values.  insert into `titles` ??? no field names to follow .. you need to indicate field names.

 

and just stating "i can't find the error" with a hidden blurb about what the issue is, is not the best way to get people's help.

you're not telling the query where to insert those values.  insert into `titles` ??? no field names to follow .. you need to indicate field names.

 

Field names aren't a requirement, it should work without them. Having said that the most like problem assume the OP doesn't have the wrong column cound or one of the values isn't string is that it doesn't like sending '' to an auto increment field. Some versions of MySQL allow it, some don't.

 

and just stating "i can't find the error" with a hidden blurb about what the issue is, is not the best way to get people's help.

 

Couldn't agree more.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.