$sql = "update products set smallpicname = $myfile ......???
$sql = "update products set smallpicname = $myfile ......???
am 02.02.2006 13:52:05 von Jim
hi, i have this
$sql = "update products set smallpicname = $myfile where id=37";
mysql_query($sql);
i want the value of $myfile to be in the $sql , but it is not doing it, so
what am i doing wrong?
how can i put variables in the $sql statement so i can execute it with
mysql_query ???
since i want also to put .....id= $idvar please help
Re: $sql = "update products set smallpicname = $myfile ......???
am 02.02.2006 14:32:21 von Tyrone Slothrop
On Thu, 02 Feb 2006 12:52:05 GMT, "Jim S." wrote:
>hi, i have this
>$sql = "update products set smallpicname = $myfile where id=37";
>mysql_query($sql);
>i want the value of $myfile to be in the $sql , but it is not doing it, so
>what am i doing wrong?
>how can i put variables in the $sql statement so i can execute it with
>mysql_query ???
>since i want also to put .....id= $idvar please help
>
Try placing some quotes around the file name:
\"$myfile\"
Re: $sql = "update products set smallpicname = $myfile ......???
am 02.02.2006 14:54:20 von Jim
i tried, :( did not work.
any other suggestions?
"Tyrone Slothrop" wrote in message
news:lc24u1li65dc3hn8lq3jkc26tmktqoovb5@4ax.com...
> On Thu, 02 Feb 2006 12:52:05 GMT, "Jim S." wrote:
>
>>hi, i have this
>>$sql = "update products set smallpicname = $myfile where id=37";
>>mysql_query($sql);
>>i want the value of $myfile to be in the $sql , but it is not doing it, so
>>what am i doing wrong?
>>how can i put variables in the $sql statement so i can execute it with
>>mysql_query ???
>>since i want also to put .....id= $idvar please help
>>
>
> Try placing some quotes around the file name:
> \"$myfile\"
Re: $sql = "update products set smallpicname = $myfile ......???
am 02.02.2006 15:37:34 von tonjo
before $sql = "update products set smallpicname = $myfile where id=37";
and see is there any value in the variable.
--
´|´ () |\|] ()
---
Navigare Necesse Est,
Vivere Non Est Necesse
www.nautika.tk
"Jim S." wrote in message
news:gaoEf.4766$Nv2.1201@newsread1.news.atl.earthlink.net...
> i tried, :( did not work.
> any other suggestions?
>
> "Tyrone Slothrop" wrote in message
> news:lc24u1li65dc3hn8lq3jkc26tmktqoovb5@4ax.com...
> > On Thu, 02 Feb 2006 12:52:05 GMT, "Jim S." wrote:
> >
> >>hi, i have this
> >>$sql = "update products set smallpicname = $myfile where id=37";
> >>mysql_query($sql);
> >>i want the value of $myfile to be in the $sql , but it is not doing it,
so
> >>what am i doing wrong?
> >>how can i put variables in the $sql statement so i can execute it with
> >>mysql_query ???
> >>since i want also to put .....id= $idvar please help
> >>
> >
> > Try placing some quotes around the file name:
> > \"$myfile\"
>
>
Re: $sql = "update products set smallpicname = $myfile ......???
am 02.02.2006 15:40:20 von tonjo
"tonjo" wrote in message
news:drt5g5$q80$1@sunce.iskon.hr...
> > "Tyrone Slothrop" wrote in message
> > news:lc24u1li65dc3hn8lq3jkc26tmktqoovb5@4ax.com...
> > > On Thu, 02 Feb 2006 12:52:05 GMT, "Jim S." wrote:
> > >
> > >>hi, i have this
> > >>$sql = "update products set smallpicname = $myfile where id=37";
> > >>mysql_query($sql);
> > >>i want the value of $myfile to be in the $sql , but it is not doing
it,
sry for last post, sent it to fast ...
I think your variable $myfile is empty.
Display it before sql statement and check.
Then you have to check why is empty ...
--
´|´ () |\|] ()
---
Navigare Necesse Est,
Vivere Non Est Necesse
www.nautika.tk
Re: $sql = "update products set smallpicname = $myfile ......???
am 03.02.2006 02:36:54 von Jim
no it is not empty, i double checked. (i echoed it)
can u remind me how to check if it is empty?
i know it is something like isempty() or something :)
thanks
Jim
"tonjo" wrote in message
news:drt5l7$qms$1@sunce.iskon.hr...
> "tonjo" wrote in message
> news:drt5g5$q80$1@sunce.iskon.hr...
>> > "Tyrone Slothrop" wrote in message
>> > news:lc24u1li65dc3hn8lq3jkc26tmktqoovb5@4ax.com...
>> > > On Thu, 02 Feb 2006 12:52:05 GMT, "Jim S." wrote:
>> > >
>> > >>hi, i have this
>> > >>$sql = "update products set smallpicname = $myfile where id=37";
>> > >>mysql_query($sql);
>> > >>i want the value of $myfile to be in the $sql , but it is not doing
> it,
>
> sry for last post, sent it to fast ...
>
> I think your variable $myfile is empty.
>
> Display it before sql statement and check.
>
> Then you have to check why is empty ...
>
> --
> ´|´ () |\|] ()
> ---
> Navigare Necesse Est,
> Vivere Non Est Necesse
> www.nautika.tk
>
>
Re: $sql = "update products set smallpicname = $myfile ......???
am 03.02.2006 08:45:33 von tonjo
"Jim S." wrote in message
news:WsyEf.10818$vU2.2333@newsread3.news.atl.earthlink.net.. .
> no it is not empty, i double checked. (i echoed it)
>
> can u remind me how to check if it is empty?
> i know it is something like isempty() or something :)
>
> thanks
> Jim
>
>
Ok I guess $myfile is CHAR field. Is value in quotes?
Like $myfile = "'smallPic.jpg'";
Maybe you fill it $myfile = "smallPic.jpg" and thats not god for sql
statement if table field is varchar.
Id field in table is integer and not need to be in quotes, like $id = 37;
If that doesn't help check are you connected to database.
You can check is empty with isset, but echo is good enough in your case.
$myfile = null;
// $myfile = "'smallPic.jpg'");
if(isset($myfile)) {
echo("myfile is: $myfile");
} else {
echo("myfile is empty");
}
--
´|´ () |\|] ()
Re: $sql = "update products set smallpicname = $myfile ......???
am 03.02.2006 13:12:40 von Jim
ok, the value if $myfile is ---> picture.gif
basically a name of a file.
and yes i am connected to the database (tested it using static value, and
echoed it)
thanks again tonjo
"tonjo" wrote in message
news:drv1ni$i9m$1@sunce.iskon.hr...
> "Jim S." wrote in message
> news:WsyEf.10818$vU2.2333@newsread3.news.atl.earthlink.net.. .
>> no it is not empty, i double checked. (i echoed it)
>>
>> can u remind me how to check if it is empty?
>> i know it is something like isempty() or something :)
>>
>> thanks
>> Jim
>>
>>
>
>
> Ok I guess $myfile is CHAR field. Is value in quotes?
>
> Like $myfile = "'smallPic.jpg'";
>
> Maybe you fill it $myfile = "smallPic.jpg" and thats not god for sql
> statement if table field is varchar.
>
>
> Id field in table is integer and not need to be in quotes, like $id = 37;
>
>
> If that doesn't help check are you connected to database.
>
>
> You can check is empty with isset, but echo is good enough in your case.
>
>
> $myfile = null;
>
> // $myfile = "'smallPic.jpg'");
>
> if(isset($myfile)) {
>
> echo("myfile is: $myfile");
>
> } else {
>
> echo("myfile is empty");
>
> }
>
>
> --
> ´|´ () |\|] ()
>
>
Re: $sql = "update products set smallpicname = $myfile ......???
am 03.02.2006 13:25:19 von tonjo
"Jim S." wrote in message
news:YMHEf.5131$Nv2.3350@newsread1.news.atl.earthlink.net...
> ok, the value if $myfile is ---> picture.gif
> basically a name of a file.
> and yes i am connected to the database (tested it using static value, and
> echoed it)
>
> thanks again tonjo
>
you are welcome :o)
hope you solved the problem
--
´|´ () |\|] ()
Re: $sql = "update products set smallpicname = $myfile ......???
am 03.02.2006 17:55:25 von Floyd
$sql="update products set smallpicname='" . $myfile. "' where id='37'";
mysql_query($sql);
"Jim S." schreef in bericht
news:VfnEf.4742$Nv2.3545@newsread1.news.atl.earthlink.net...
> hi, i have this
> $sql = "update products set smallpicname = $myfile where id=37";
> mysql_query($sql);
> i want the value of $myfile to be in the $sql , but it is not doing it, so
> what am i doing wrong?
> how can i put variables in the $sql statement so i can execute it with
> mysql_query ???
> since i want also to put .....id= $idvar please help
>