For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > June 2004 > RE: Subject: Update data problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: Subject: Update data problem
Justin Baiocchi

2004-06-24, 10:22 pm

Hi Neil,

I have tried it like that with no luck, what is below just happens to be
my latest attempts to get it working.

What is happening is that it is saying that $C and $G are zero, when in
fact there is data in there.

How do I get it to 'refresh' the variables? That is what I am trying to
do with:
>$query =3D "SELECT C, G FROM media";
>$result =3D mysql_query($query);



-----Original Message-----
From: Neil Smith [MVP, Digital media]
[mailto:php@comatose.freeserve.co.uk]=20
Sent: Friday, 25 June 2004 1:51 AM
To: php-db@lists.php.net
Cc: Baiocchi, Justin (LI, Armidale)
Subject: Re: Subject: Update data problem


Is there any obvious reason why you're not doing this in one query

$query =3D "UPDATE media SET A=3D'$A', B=3D'$B', C=3D'$C', G=3DE*'$C'";

Or have I missed something here ?

Cheers - Neil

At 10:07 24/06/2004 +0000, you wrote:
>MIME-Version: 1.0
>Content-Type: multipart/alternative;
> boundary=3D"----_=3D_NextPart_001_01C459A5.F8D9AF1D"
>Date: Thu, 24 Jun 2004 14:44:45 +1000
>Message-ID:

< 39B7E7009F2DD840AA747934AB551E6917169B@e
xnsw1-arm.nsw.csiro.au>
>From: <Justin.Baiocchi@csiro.au>
>To: <php-db@lists.php.net>
>Subject: Update data problem
>
>
>if($update)
>
>{
>
>mysql_pconnect("localhost","root","password");
>mysql_select_db("options");
>
>
>$query =3D "UPDATE media SET A=3D'$A', B=3D'$B', C=3D'$C'";
>$result =3D mysql_query($query);
>
>$query =3D "SELECT C, G FROM media";
>$result =3D mysql_query($query);
>
>$E=3D "$C*$G";
>
>
>$query =3D "UPDATE media SET E=3D'$E'";
>$result =3D mysql_query($query);
>
>}



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
CaptionKit http://www.captionkit.com : Production tools
for accessible subtitled internet media, transcripts
and searchable video. Supports Real Player, Quicktime
and Windows Media Player.

VideoChat with friends online, get Freshly Toasted every
day at http://www.fresh-toast.net : NetMeeting solutions
for a connected world.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com