Jump to content

Edit History

Ikoshop

Ikoshop


solved

I'm getting acquainted with reading and writing from the Prestashop database. I  am trying to get an INSERT statement to work.


image.thumb.png.1a3f7be527bb053ebbf43fd9fa0d7510.png

$result should be true or false here, but instead it's a null value and nothing is written to the database. 

The command itself, if I run it from the phpmyadmin interface, works just fine.

The docs mention using _DB_PREFIX_ but I'm not sure what the point of that is, and if I have to remove the 'ps_' just to re-add it with the prefix variable?
 

EDIT: updated opening post as the site blocking the SQL quote made it too confusing.

Ikoshop

Ikoshop

I'm getting acquainted with reading and writing from the Prestashop database. I  am trying to get an INSERT statement to work.


image.thumb.png.1a3f7be527bb053ebbf43fd9fa0d7510.png

$result should be true or false here, but instead it's a null value and nothing is written to the database. 

The command itself, if I run it from the phpmyadmin interface, works just fine.

The docs mention using _DB_PREFIX_ but I'm not sure what the point of that is, and if I have to remove the 'ps_' just to re-add it with the prefix variable?
 

EDIT: updated opening post as the site blocking the SQL quote made it too confusing.

Ikoshop

Ikoshop

I'm getting acquainted with reading and writing from the Prestashop database. I can get select statements to work fine.

Example: to get a list of used categories

EXAMPLE ONE

This returns data as it should.

When I try to Insert using executeS there's an error message saying this method can't be used for Insert.

From the docs I found that using simple execute (no S) should work, e.g.


EXAMPLE TWO

 

$result should be true or false here, but instead it's a null value and nothing is written to the database. 

The command itself, if I run it from the phpmyadmin interface, works just fine.

The docs mention using _DB_PREFIX_ but I'm not sure what the point of that is, and if I have to remove the 'ps_' just to re-add it with the prefix variable?

EXAMPLE THREE

Is there an equivalent to executeS for inserting/deleting that actually works?

 

Edit: seems I can't paste SQL directly here. Added it to this link


https://ctxt.io/2/AAB4huaFEw

Ikoshop

Ikoshop

I'm getting acquainted with reading and writing from the Prestashop database. I can get select statements to work fine.

Example: to get a list of used categories

EXAMPLE ONE

This returns data as it should.

When I try to Insert using executeS there's an error message saying this method can't be used for Insert.

From the docs I found that using simple execute (no S) should work, e.g.


EXAMPLE TWO

 

$result should be true or false here, but instead it's a null value and nothing is written to the database. 

The command itself, if I run it from the phpmyadmin interface, works just fine.

The docs mention using _DB_PREFIX_ but I'm not sure what the point of that is, and if I have to remove the 'ps_' just to re-add it with the prefix variable?

EXAMPLE THREE

Is there an equivalent to executeS for inserting/deleting that actually works?

 

Edit: seems I can't paste SQL directly here. Added it to this link

https://qtext.io/8j0m

×
×
  • Create New...