9 Replies - 648 Views - Last Post: 18 June 2009 - 12:52 AM Rate Topic: -----

#1 shammysgames  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-June 09

Cant get info to transfer to database from the form!

Post icon  Posted 18 June 2009 - 12:27 AM

Trying to get a simple form to transfer info to the database. I finally got it to work with no errors, but I cant get it to add the info to the database. The first field in the table id the ID and it auto.(not sure if that makes a difference)

Here is my code:

<? require "../dbsql.php";require "security.php";?>

<?php

$name=($_POST['note']); 
$email=($_POST['date']); 
$sql="INSERT INTO budget_new_transaction (note,date) VALUES ('$name','$email')";

?>


Thanks

This post has been edited by shammysgames: 18 June 2009 - 12:30 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Cant get info to transfer to database from the form!

#2 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: Cant get info to transfer to database from the form!

Posted 18 June 2009 - 12:30 AM

:code:
try this:
$name=($_POST['note']);
$email=($_POST['date']);
$sql="INSERT INTO budget_new_transaction (note,date) VALUES ('$name','$email')";
mysql_query = ($sql)or die(mysql_error());

Was This Post Helpful? 0
  • +
  • -

#3 shammysgames  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-June 09

Re: Cant get info to transfer to database from the form!

Posted 18 June 2009 - 12:33 AM

Thansk, now I get this error:

Parse error: parse error, unexpected '=' in /home/content/s/h/a/shammysgames/html/admin/CODY3.php on line 8
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5178
  • View blog
  • Posts: 26,870
  • Joined: 10-May 07

Re: Cant get info to transfer to database from the form!

Posted 18 June 2009 - 12:38 AM

Can you post the new code so we can see what is on line 8?
Was This Post Helpful? 0
  • +
  • -

#5 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: Cant get info to transfer to database from the form!

Posted 18 June 2009 - 12:38 AM

could you please past your CODY3.php page to see what is your error.
Was This Post Helpful? 0
  • +
  • -

#6 shammysgames  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-June 09

Re: Cant get info to transfer to database from the form!

Posted 18 June 2009 - 12:41 AM

http://www.shammysga...admin/CODY3.php

<? require "../dbsql.php";require "security.php";?>

<?php

$name=($_POST['note']);
$email=($_POST['date']);
$sql="INSERT INTO budget_new_transaction (note,date) VALUES ('$name','$email')";
mysql_query = ($sql)or die(mysql_error());
?>

Was This Post Helpful? 0
  • +
  • -

#7 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5178
  • View blog
  • Posts: 26,870
  • Joined: 10-May 07

Re: Cant get info to transfer to database from the form!

Posted 18 June 2009 - 12:42 AM

mysql_query is a command, not a variable.

<? require "../dbsql.php";require "security.php";?>

<?php

$name=($_POST['note']);
$email=($_POST['date']);
$sql="INSERT INTO budget_new_transaction (note,date) VALUES ('$name','$email')";
mysql_query($sql) or die(mysql_error());
?>

Was This Post Helpful? 0
  • +
  • -

#8 shammysgames  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-June 09

Re: Cant get info to transfer to database from the form!

Posted 18 June 2009 - 12:45 AM

What do i need to change to get it to transfer to the database.?
Thanks
Was This Post Helpful? 0
  • +
  • -

#9 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: Cant get info to transfer to database from the form!

Posted 18 June 2009 - 12:51 AM

use no2pecil's code,
is there any error.
check your connection is there any connection.
Was This Post Helpful? 0
  • +
  • -

#10 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5178
  • View blog
  • Posts: 26,870
  • Joined: 10-May 07

Re: Cant get info to transfer to database from the form!

Posted 18 June 2009 - 12:52 AM

I posted the change...

mysql_query($sql) or die(mysql_error());


not

mysql_query = ($sql)or die(mysql_error());


I changed it in my previous post :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1