?php
$id=$_POST['id'];
$name=$_POST['name'];
$email=$_POST['email'];
$password=$_POST['password'];
$mobile=$_POST['mobile'];
$con=@mysql_connect("localhost","root","") or die(mysql_error());
$db=@mysql_select_db("click",$con)or die(mysql_error());
$sql="UPDATE kncet SET('{$name}','{$email}','{$password}','{$mobile}' WHERE
'{$name}')";
$res=@mysql_query($str)or die(mysql_error());
if($res>=0)
{ echo "Successful"; }
else{
echo(" <strong> <p>Insertion delivery failed...try later! and Also enter
email has been used already.</p> </strong>");
}
?>
U can find database in this code
On Tue, Oct 14, 2014 at 1:42 PM, P.R.Karthik <[email protected]> wrote:
> I do not see the database name in the connection string.
>
>
> Regards,
> KarthiK.P.R
>
> On Tue, Oct 14, 2014 at 1:35 PM, Kumar <[email protected]> wrote:
>
> > Hi ,
> >
> > First run the query in MySQL and then try with code.
> > -1 Check Query
> > -2 Check script
> >
> > User echo and print_r() to see outputs.
> >
> > echo
> > $sql="UPDATE kncet SET id='$id', name='$name', sex='$sex',
> email='$email',
> > password='$password', mobile='$mobile' WHERE name='$name'";
> >
> > echo $sql; // check output with values.
> >
> >
> >
> > With Thanks and Regards,
> > Kumar
> > m: +91 94434 55374
> > im: send4kumar [ skype ]
> >
> > On Tue, Oct 14, 2014 at 1:29 PM, kavin raj <[email protected]> wrote:
> >
> > > On Tue, Oct 14, 2014 at 1:20 PM, Shrinivasan T <[email protected]
> >
> > > wrote:
> > >
> > > > > $str="UPDATE kncet SET('$name','$email','$password','$mobile' WHERE
> > > > > id='$id')";
> > > >
> > > > print the entire query to test it.
> > > >
> > > > echo $str;
> > > >
> > > > and execute the same in the mysql shell.
> > > >
> > > >
> > > > --
> > > > Regards,
> > > > T.Shrinivasan
> > > >
> > > >
> > >
> > > UPDATE kncet SET('20', 'Kavin','Female', '[email protected]
> > > ','sdfsdg','8124455131'
> > > WHERE name='Kavin')
> > > 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 '('20',
> > > 'Kavin','Female', '[email protected]','sdfsdg','8124455131' WHERE
> > name='Kavi'
> > > at line 1
> > >
> > > I had try this code
> > >
> > > $sql="UPDATE kncet SET id='$id', name='$name', sex='$sex',
> > email='$email',
> > > password='$password', mobile='$mobile' WHERE name='$name'";
> > >
> > > but it shows Query was empty
> > > _______________________________________________
> > > ILUGC Mailing List:
> > > http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
> > > ILUGC Mailing List Guidelines:
> > > http://ilugc.in/mailinglist-guidelines
> > >
> > _______________________________________________
> > ILUGC Mailing List:
> > http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
> > ILUGC Mailing List Guidelines:
> > http://ilugc.in/mailinglist-guidelines
> >
> _______________________________________________
> ILUGC Mailing List:
> http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
> ILUGC Mailing List Guidelines:
> http://ilugc.in/mailinglist-guidelines
>
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines