Jump to content


Photo

MySql Insert problem


  • Please log in to reply
2 replies to this topic

#1 wirenut

wirenut
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 April 2006 - 05:34 PM

I'm using Frontpage 2003, with Godaddy host. I'm not sure if it is Frontpage or godaddy host but I've copied some script and tried them and I keep getting Parse errors:

The insert program below keeps getting the error

Parse error: parse error, unexpected $ on line 27


Can someone help? I'm looking for insert and select scripts that would be easy to modify


<?php


/* Make connection to database */

//Connect To Database
$hostname="**************";
$username="*********";
$password="**********";
$dbname="***********";
$usertable="*****";
$$logon = "****";
$pass = "*****";


mysql_connect($hostname,$username, $password) OR DIE ("Unable to connect to database! Please try again later.");
mysql_select_db($dbname);


$query = "INSERT INTO $usertable (user,password) values ('$logon','$pass');
$result = mysql_query($query);




?>








#2 Dobakat

Dobakat
  • Members
  • PipPipPip
  • Advanced Member
  • 54 posts

Posted 19 April 2006 - 05:46 PM

You are forgetting a " in:
$query = "INSERT INTO $usertable (user,password) values ('$logon','$pass');

it should be as:
$query = "INSERT INTO $usertable (user,password) values ('$logon','$pass')";



#3 wirenut

wirenut
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 20 April 2006 - 05:02 AM

Thank You Dobakat

I've went over and over this program and never seen the quote missing.

It works now thanks to you

Thanks again.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users