Jump to content
The Uniform Server Community

spark

Member
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

1 Follower

About spark

  • Rank
    Newbie

Previous Fields

  • Main OS
    Windows XP
  1. Thanks for your time. I changed the code a little but still get the same results , It works if I subsitute the value for $itemNum. the code: <?php $itemNum = '123456789'; $title = 'test title'; $strtime = 'FEB-23-08 12:02:02'; $user="tim"; $password="supers"; $database="silver"; $db = mysql_connect(localhost,$user,$password); mysql_select_db($database,$db) or die( "Unable to select database"); $query ="INSERT INTO horse SET id = '' , itemNum = '.$itemNum.' , title = 'this is y', strDate = '1:05' "; echo $query; mysql_query($query,$db); mysql_close(); ?> I put the echo statement in to see $query, here is what it prints: INSERT INTO horse SET id = '' , itemNum = '.123456789.' , title = 'this is y', strDate = '1:05' Magic dots do not seem to work for me.....
  2. Here is the code. When I run it I don't get any error messages. I also don't get the values inserted into a record. Here is the code: <?php $itemNum = '123456789'; $title = 'test title'; $strtime = 'FEB-23-08 12:02:02'; $user="tim"; $password="supers"; $database="silver"; $db = mysql_connect(localhost,$user,$password); mysql_select_db($database,$db) or die( "Unable to select database"); $query ="INSERT INTO `silver`.`horse` SET `id` = '' , `itemNum` = '$itemNum' , `title` = 'this is y', `strDate` = '1:05' "; mysql_query($query,$db); mysql_close(); ?> When I put the value of $itemNum (123456789) in the query works and makes a new record. I have tried $itemNum without the single qoutes , '{$itemNum}' , '@$itemNum','@itemNum', without sucess. I have seen the form'$itemNum' , on the internet , but it doesn't seem to work for me. I would like to use all php variables in the sql querry. Thanks for the help.
×
×
  • Create New...