CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 what on earth is wrong with this?

Print topic Send  topic

Author Message
montymoose


Posts: 85
Posted: 01/13/2008, 9:06 AM

global $DBMySQL;  
$SQL = "UPDATE contact SET contact_type = 2 WHERE contact_id = 20";  
$DBMySQL->query($SQL);

This event is meant to occur when the user clicks a button... any ideas why it doesn't work?

Thanks,

M00S3
View profile  Send private message
ckroon

Posts: 869
Posted: 01/13/2008, 5:24 PM

I believe you need ' ' marks around the 2 and the 20.. but I am by no means an expert. that is what I would try.

_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
montymoose


Posts: 85
Posted: 01/14/2008, 2:13 AM

global $DBMySQL;    
$SQL = "UPDATE contact SET contact_type = '2' WHERE contact_id = '20'";    
$DBMySQL->query($SQL);

Thanks mate, but that still doesn't work... any more suggestions? 8-)
View profile  Send private message
datadoit
Posted: 01/14/2008, 5:46 AM

montymoose wrote:
>
global $DBMySQL;  
> $SQL = "UPDATE contact SET contact_type = 2 WHERE contact_id = 20";  
> $DBMySQL->query($SQL);
>
> This event is meant to occur when the user clicks a button... any ideas why it
> doesn't work?
>
> Thanks,
>
> M00S3
> ---------------------------------------

Make sure there's already a connection on the page, otherwise using the
existing connection won't work. I always like to use new connections
just to avoid any surprises.

global $DBMySQL;
$db = new clsDBMySQL();
$SQL = "UPDATE contact SET contact_type = '2' WHERE contact_id = '20'";
$db->query($SQL);
$db->close();

Secondly, as already suggested, may want to use semi-quotes on your
field values. Not always necessary, but will avoid throwing SQL errors
on blank values.

Finally, make absolute certain that you have a field with a contact_id
value of 20.
dbeckett90

Posts: 1
Posted: 01/14/2008, 11:36 AM

$db->query("UPDATE contact SET contact_type = 2 WHERE contact_id= 20 ");
Been fighting it too, this worked for me :)
View profile  Send private message
montymoose


Posts: 85
Posted: 01/14/2008, 11:40 AM

Cheers dude...! CCS is like an old cherished car... you love it to bits but sometimes when you can't get it to go it does your head in!! :-D
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.