Re: i getting this warning [message #176015 is a reply to message #176014] |
Wed, 16 November 2011 11:26 |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma:
|
Senior Member |
|
|
sri kanth wrote:
> mysql_fetch_row(): supplied argument is not a valid MySQL result
> below my code:
> <?php
> $qs=$_REQUEST['id'];
> mysql_connect("localhost","root","");
> mysql_select_db("test");
> $data=mysql_query("select * from tbl_porduct where pid=$qs");
> $rec=mysql_fetch_row($data);
> $pname=$rec[1];
> $price=$rec[3];
> $sid=session_id();
> mysql_query("insert into tbl_spro values('$sid','$pname','$price')");
> ?>
>
I am not surprised
$data=mysql_query("select * from tbl_porduct where pid=$qs");
is not going to win friends and influence people
Try
$data=mysql_query(sprintf("select * from tbl_porduct where pid=%d",$qs));
and check whether 'tbl_porduct' should in fact be 'tbl_product'.
|
|
|