Jump to content

Creon

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Creon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thats helpfull. tnx. Everything works now.
  2. [!--quoteo(post=363725:date=Apr 11 2006, 12:16 PM:name=PyroSmurf)--][div class=\'quotetop\']QUOTE(PyroSmurf @ Apr 11 2006, 12:16 PM) [snapback]363725[/snapback][/div][div class=\'quotemain\'][!--quotec--] yes, thanks. that made it quite clear or at least i think so. Saved your explination on my comp if i ever need e reference hehe. Still have a problem with the script. I did the changes you showed me. And I used Timestamp as sql typ for the date. But now it returns a sql syntax error. You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '04.11.06')' at line 1 [code] <?php // Login file include("login.php"); //connect to database $conn = mysql_connect($server, $db_user, $db_pass) or die ("UPPKOPPLINGS FEL"); mysql_select_db($database,$conn) or die ("Could not open database"); $title = $_POST['title']; $text = $_POST['text']; $pass = $_POST['pass'];   $ttime = date("m.d.y"); echo "$title  $text  $ttime "; //insert the values $insert = "INSERT INTO blog (title,`text`,click,`time`) VALUES ('$title','$text,'','$ttime')"; mysql_query($insert) or die (mysql_error()); php?> [/code] im alsow wondering if i could shorten the script by changing (thus removing the click value since its emty, altho i have a click table in the blog database) [code] $insert = "INSERT INTO blog (title,`text`,click,`time`) VALUES ('$title','$text,'','$ttime')"; [/code] to [code] $insert = "INSERT INTO blog (title,`text`,`time`) VALUES ('$title','$text,'$ttime')"; [/code] [/quote]
  3. yes, thanks. that made it quite clear or at least i think so. Saved your explination on my comp if i ever need e reference hehe. Still have a problem with the script. I did the changes you showed me. And I used Timestamp as sql typ for the date. But now it returns a sql syntax error. You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '04.11.06')' at line 1 [code] <?php // Login file include("login.php"); //connect to database $conn = mysql_connect($server, $db_user, $db_pass) or die ("UPPKOPPLINGS FEL"); mysql_select_db($database,$conn) or die ("Could not open database"); $title = $_POST['title']; $text = $_POST['text']; $pass = $_POST['pass'];   $ttime = date("m.d.y"); echo "$title  $text  $ttime "; //insert the values $insert = "INSERT INTO blog (title,`text`,click,`time`) VALUES ('$title','$text,'','$ttime')"; mysql_query($insert) or die (mysql_error()); php?> [/code] im alsow wondering if i could shorten the script by changing (thus removing the click value since its emty, altho i have a click table in the blog database) [code] $insert = "INSERT INTO blog (title,`text`,click,`time`) VALUES ('$title','$text,'','$ttime')"; [/code] to [code] $insert = "INSERT INTO blog (title,`text`,`time`) VALUES ('$title','$text,'$ttime')"; [/code]
  4. thanks Still a bit confused for when to use ' , ", ` or nothing at all. Im alsow wondering what type i should use for the $time in the sqldatabase.
  5. Ive been looking at this script for an hour or so and know that it have to be a fundamental error. I just cant see it. The following code is to write a blog enterie from a form to a database table called 'blog' . [code] <?php // Login file include("login.php"); //connect to database $conn = mysql_connect($server, $db_user, $db_pass) or die ("UPPKOPPLINGS FEL"); mysql_select_db($database,$conn) or die ("Could not open database"); $title = $_POST['title']; $text = $_POST['text']; $pass = $_POST['pass'];   $time = date("m.d.y"); echo "$title  $text  $ttime "; //insert the values $insert = "INSERT INTO `blog` ( `id` , `title` , `text` , `click` , `time` ) VALUES ( '', $title , $text, '' , $time )"; mysql_db_query($database, $insert) or die ("did not send"); php?> [/code] There is no real error showd exept for "did not send". everything else works. So im inclined to think that this part is wrong, just cant see it. [code] //insert the values $insert = "INSERT INTO `blog` ( `id` , `title` , `text` , `click` , `time` ) VALUES ( '', $title , $text, '' , $time )"; mysql_db_query($database, $insert) or die ("did not send"); [/code]
×
×
  • 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.