TOPIC:

Database queries 1 month 1 week ago #247930

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 803
Ok, and what happens if you execute exactly this query in phpmyadmin?
UPDATE `h8be5_eventregistration` 
SET `countnow`= `countnow` + 3
 WHERE `eventdate`  =  '20200913' and `arrival` = '11:15-11:30'  

Does it update the record then or not?

Please Log in or Create an account to join the conversation.

Database queries 1 month 1 week ago #247931

  • Topic Author
  • ooc
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 231
  • Thanks: 1
yes. count was 26 - updated to 29

Please Log in or Create an account to join the conversation.

Database queries 1 month 1 week ago #247933

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 803
ok, cool, then please update your code and add $db->execute(), so it looks like this
$db->setQuery("UPDATE `h8be5_eventregistration` 
 SET `countnow` =   `countnow` + " . $db->quote($groupsize)
 . " WHERE `eventdate`  =  " .  $db->quote($eventdate) . "and `arrival` = " . $db->quote($arrival));

$db->execute();

Regards,
Markus

Please Log in or Create an account to join the conversation.

Database queries 1 month 1 week ago #247934

  • Topic Author
  • ooc
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 231
  • Thanks: 1
I have also duplicated my form and table but changing eventdate to be of date type with values like 2020-09-13 and run the SQLs against the new table The behaviour is the same - ECHO gives me a valid workable SQL but the after form piece does not do an update.

Please Log in or Create an account to join the conversation.

Database queries 1 month 1 week ago #247935

  • Topic Author
  • ooc
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 231
  • Thanks: 1
entering
$this->execPieceByName('ff_InitLib');
$arrival = ff_getSubmit('arrival');
$groupsize = ff_getSubmit('groupsize');
$eventdate = ff_getSubmit('eventdate');
$db = JFactory::getDbo(); 

$db->setQuery("UPDATE `h8be5_eventregistration` 
 SET `countnow` =   `countnow` + " . $db->quote($groupsize)
 . " WHERE `eventdate`  =  " .  $db->quote($eventdate) . "and `arrival` = " . $db->quote($arrival));

$db->execute();
did not work either.

Please Log in or Create an account to join the conversation.

Database queries 1 month 1 week ago #247936

  • Topic Author
  • ooc
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 231
  • Thanks: 1
I entered
$this->execPieceByName('ff_InitLib');
$arrival = ff_getSubmit('arrival');
$groupsize = ff_getSubmit('groupsize');
$eventdate = ff_getSubmit('eventdate');
$db = JFactory::getDbo(); 

$db->setQuery("UPDATE `h8be5_eventregistration` 
 SET `countnow` =   `countnow` + " . $db->quote($groupsize)
 . " WHERE `eventdate`  =  " .  $db->quote($eventdate) . "and `arrival` = " . $db->quote($arrival));

$db->execute();
echo "UPDATE `h8be5_eventregistration` 
 SET `countnow` =   `countnow` + " . $db->quote($groupsize)
 . " WHERE `eventdate`  =  " .  $db->quote($eventdate) . "and `arrival` = " . $db->quote($arrival);
exit;
Got back
UPDATE `h8be5_eventregistration` SET `countnow` = `countnow` + '1' WHERE `eventdate` = '20200913'and `arrival` = '11:00-11:15'
but 11:00-1:15 stil has countnow is 0

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!