Relative Content

Tag Archive for phpmysql

How to gret lastInsertId() after using a temp table

I am duplicating a row within a table. The primary key should auto update, so I remove that Primary Key value (MenuID) from the select in a temporary table and allow the insert to create a value for the new row.

mysqli::execute_query UPDATE many columns from webform

I am trying to UPDATE many columns in a mysql row using values passed from a webform.
I have to do this with several different tables and row combinations, so am trying to develop some reusable code, as coding in each QUERY with all the specified columns and parameters is a bit cumbersome and prone to alignment errors.

Php foreach is not getting the values from MySQL fetched arrays

Am trying to alternate through MySQL fetch array using foreach but it’s not working.
If I echo the result of the array, I will see the list of arrays but if want to pick the values of the array using foreach it will tell me ” invalid argument supplied for foreach. This is my code. Pls help me.