I am looking for a way to test just the connection portion of a php / mysqli connection. I am migrating from a LAMP server build on Vista to the same on Ubuntu and am having fits getting mysqli to work. I know that all of the proper modules are installed, and PhpMyAdmin works flawlessly. I have migrated a site
Tag: mysqli
Return an array from mysqli stmt query
I’m trying to convert a site to use prepared mysql statements, however I’m having some trouble replacing my use of fetch_array(). The comments on php.net offer a solution which I would have thought should work but for some reason I’m getting strange undefined constant errors when calling a function via call_user_func_array() can someone suggest a better way of doing it?
How can I alternate between mysqli_real_escape_string and nl?
I’ve been doing some reading on mysqli_real_escape_string(), and, after getting my content properly escaped, I’m having some trouble getting to display properly when I pull it out again. Here’s the …
How can I determine mySQL prepared statement result column names in PHP?
That is, with a prepared statement like: I believe I can use $mysqli->field_count to get the number of columns being returned (haven’t tried). But is there a way to link each column name to the values returned in bind_results? I could always try to parse the column names out from the command itself, but that’s not a road I want
How to solve “Fatal error: Class ‘MySQLi’ not found”?
I am doing a tutorial and am getting this error: Fatal error: Class ‘MySQLi’ not found (LONG URL) on line 8 The code on line 8 is: $mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name); …
How to bind mysqli parameters using loop and store results in array?
The code above gets the value from genreID when dbGenre is equal to $genre. And then store the results in an array. But it’s not working because $genre is an array, so I need to loop through it to get a different value from genreID each time. The ‘genres’ table contains two columns: genreID (INT) and dbGenre (VARCHAR) I just
Limit a MySQL query to an even number of results
I have a bit of PHP code which I need to return an even number of results from a MySQL database. I’m using the mysqli extension to execute my query. My code is approximately this at the moment: //…
Variable parameter/result binding with prepared statements
In a project that I’m about to wrap up, I’ve written and implemented an object-relational mapping solution for PHP. Before the doubters and dreamers cry out “how on earth?”, relax — I haven’t found a way to make late static binding work — I’m just working around it in the best way that I possibly can. Anyway, I’m not currently