Skip to content
Advertisement

Tag: sql

PHP looping over data and getting key/value pairs

I’m using Laravel 8 to loop over some data. I’ve got my data out from my database, but am struggling to loop over the data in a foreach loop, it doesn’t appear to be giving me the key/value pairs, only the index/value pair? But if I var_dump() my $applicationOptions I can see the array inside of the attributes and the

get users that did not buy a product

I have three tables users table products table users_buy table I want to get users who did not buy a specific product for example, user number 20 bought 5 product with ids [1,2,3,4,5] and user number 19 bought 3 product with ids [1,2,3] And user number 18 bought 2 product with ids [1,3] I want to get users who did

SQL not Inserting using PHP

I have the following code sending data from a form to an SQL database: My database table is structured as with studentID being a primary key auto incrementing and all fields apart from dob as text (dob is set as datetime) The form which is sending the data looks like this: I’m not getting a PDO error but the data

Advertisement