Showing posts with the label php

[FIXED] php postgres UPDATE: check for success

Issue I'm attempting to UPDATE my postgres table on Heroku and have been blocked by the eccentr…

[FIXED] Laravel boolean returns "1"/"0" instead of true/false in query

Issue I have a query that returns a boolean field (by the way, I'm on an SQL Server) on my REST…

[FIXED] How to insert unique email into mysql table

Issue I want to take email addresses from users to add them to a mailing list. However, I want to p…

[FIXED] How to catch warnings for mysqli_connect()

Issue How do I catch warnings for mysqli_connect() Example if (!$connection2 = mysqli_connect($ho…

[FIXED] Get insert_id for all rows inserted in single mysqli query (multiple values)

Issue Working in PHP and using MYSQLI. Trying to get the insert_id for all rows inserted from a sin…

[FIXED] Warning: mysqli_query() expects parameter 1 to be mysqli, null given in PHP

Issue I'm having trouble with using a mysqli_query inside a function, error: Warning: mysqli_q…

[FIXED] Should we ever check for mysqli_connect() errors manually?

Issue The PHP manual for mysqli_connect() suggests checking for the return value and displaying

[FIXED] Why can't I run two mysqli queries? The second one fails

Issue Is it possible to have two mysqli queries like so? mysqli_query($dblink, "INSERT INTO …

[FIXED] NULL output with SQL Join

Issue my problem is I received NULL output. What is the problem with my query? $pr_code = $mysqli…

[FIXED] What's wrong with my query — mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in

Issue I know that the above message occurs becomes of wrong MySQL query, but what's wrong with …

[FIXED] Commands out of sync; you can't run this command now

Issue I am trying to execute my PHP code, which calls two MySQL queries via mysqli, and get the err…

[FIXED] Does installing mysqli mean my mysql queries won't work anymore?

Issue I'm about to start work converting my mysql queries to mysqli, and am wondering if instal…

[FIXED] Getting multiple rows with prepared statement

Issue I'm quite new to prepared statements and am not sure I am doing this right. Here is what…

[FIXED] Converting MySQL result array to JSON

Issue I want to convert my database query's result array to JSON format in PHP. Here is my code…

[FIXED] Is freeing result sets necessary for mysqli persistent connections?

Issue According to mysqli document , Open non-persistent MySQL connections and result sets

[FIXED] Selecting the latest entry in a single MYSQL column and assigning it to a php variable

Issue I have a 4 column mysql table, the leftmost being the autoincrement column and I'd like t…

[FIXED] Build SELECT query with dynamic number of LIKE conditions as a mysqli prepared statement

Issue I am trying to write prepared statement for user input. parameter numbers are variable depend…

[FIXED] Undefined property: mysqli_stmt::$bind_param

Issue I want to bind variable number parameters using call_user_func_array in this way(please read…

[FIXED] PHPs mysqli prepare - generate dynamically

Issue My code to generate the SQL statement works fine - however I run into a hiccup when generatin…

[FIXED] How to insert into MySQL using a prepared statement with PHP

Issue I am just learning about databases and I want to be able to store user inputs. What would be …