pls help in this code in storing a data

Reply

Join Date: Feb 2009
Posts: 6
Reputation: nawabsheriff is an unknown quantity at this point 
Solved Threads: 0
nawabsheriff nawabsheriff is offline Offline
Newbie Poster

pls help in this code in storing a data

 
0
  #1
Feb 6th, 2009
<?php
$conn = new mysql('localhost', 'root', 'adm1ns');
$sq1 ="INSERT INTO data VALUES(?,?,?);
$stmt = $conn->stmt_init();
$stmt->prepare($sql);
$stmt->bind_param("sss",$instance,$instance,$instance);
$stmt->execute();
$stmt->fetch();
?>


i use this code to store the data in mysql given by user...

in sixth line i am getting a error "unexpected T_STRING" i cant cant this error pls help me
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 10
Reputation: jagadishwor is an unknown quantity at this point 
Solved Threads: 1
jagadishwor's Avatar
jagadishwor jagadishwor is offline Offline
Newbie Poster

Re: pls help in this code in storing a data

 
0
  #2
Feb 6th, 2009
Originally Posted by nawabsheriff View Post
<?php
$conn = new mysql('localhost', 'root', 'adm1ns');
$sq1 ="INSERT INTO data VALUES(?,?,?);
$stmt = $conn->stmt_init();
$stmt->prepare($sql);
$stmt->bind_param("sss",$instance,$instance,$instance);
$stmt->execute();
$stmt->fetch();
?>


i use this code to store the data in mysql given by user...

in sixth line i am getting a error "unexpected T_STRING" i cant cant this error pls help me
<?php
$conn = new mysql('localhost', 'root', 'adm1ns');
$sq1 ="INSERT INTO data VALUES(?,?,?);
$stmt = $conn->stmt_init();
$stmt->prepare($sql);
$stmt->bind_param("sss",$instance,$instance,$instance);
$stmt->execute();
$stmt->fetch();
?>


Hey you have done mistake in your line 2.
look
$sq1 ="INSERT INTO data VALUES(?,?,?);
Close it like
$sq1 ="INSERT INTO data VALUES(?,?,?)";

ok
http://www.jagadishwor.com.np
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 6
Reputation: nawabsheriff is an unknown quantity at this point 
Solved Threads: 0
nawabsheriff nawabsheriff is offline Offline
Newbie Poster

Re: pls help in this code in storing a data

 
0
  #3
Feb 6th, 2009
thanks jagadish...

i found the problem.....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC