Jump to content

Recommended Posts

I have a select and an update query that work perfectly if I manually enter the record numbers for cf_565,  and id.  The  fields get updated as they should.  as soon as I try to use the variables $cf_565 and $id it fails.  I get no error messages.  Here is my code

 

$result15 = mysql_query("SELECT

vtiger_crmentity.description,

vtiger_troubletickets.solution,

vtiger_troubletickets.ticketid

FROM

vtiger_troubletickets

Inner Join vtiger_crmentity ON vtiger_troubletickets.ticketid = vtiger_crmentity.crmid

WHERE

vtiger_troubletickets.ticketid =  $cf_565");



$row = mysql_fetch_array($result15);

$trouble= $row['description'];

$fix =$row['solution'];

$sql = "Update communiq_vtcrm1.vtiger_invoice x, communiq_vtcrm1.vtiger_crmentity z Set x.terms_conditions= '$fix' , z.description='$trouble' Where z.crmid = $id and x.invoiceid = $id";

$result = mysql_query($sql);

 

I would also like to use an IF statement to ignore the above code and continue using another variable  such as $cf_581 which is a checkbox and it would be true with a 1

Thanks for suggestions where I am going wrong

Link to comment
https://forums.phpfreaks.com/topic/192307-need-help-with-variables-in-query/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.