How do I get the actual max length of a specified column in php (prior to PHP7)? For instance, this table: id – int(11) name – string(20) I want in php to select the maximum number of characters that a field can have, like and it should then return 20 (since it’s the maximum number of charac…
Tag: mysql
Outputting all PHP errors to database not error_log
Is it possible to make all PHP errors be written to MySQL instead of to the standard error_log file. I guess this would be possible if i wrote my own error handler from scratch but i have a lot of legacy code in place and ideally i would just make 1 global change and that would be it. Can this
select field information with min time value
I thought I was doing the right thing but I keep getting the wrong result. I am trying to simply find the id of the entry with the min time, but I am not getting that entry. $qryuserscount1=”…
How can we re-use the deleted id from any MySQL-DB table?
How can we re-use the deleted id from any MySQL-DB table? If I want to rollback the deleted ID , can we do it anyhow?
PHP & MySQL Pagination
I have a MySQL query I want to paginate 10 results per page. How Can I do it? Answer Here is a nice starting point:
Get value of input box, without a form?
Does anyone know how I can get the value of an input box, without having a form? I want a submit button, but instead of submitting a form, I want it to change data in a MySQL database. Something like this maybe? Could I use that code on a “onclick” event? The input box’s name and id is ̶…
How to select rows where column value IS NOT NULL using CodeIgniter’s ActiveRecord?
I’m using CodeIgniter’s Active Record class to query the MySQL database. I need to select the rows in a table where a field is not set to NULL: That only returns this query: The archived field is a DATE field. Is there a better way to solve this? I know I can just write the query myself, but I wan…
mysql get last auto increment value
Hi I have a field in mySql table called jobnumber which auto increments with each new entry. What I want to do is when a user views my form, get the value of the next ‘jobnumber’ . But I want to do …
generate a unique hash value which can be used as primary key in mysql thru php
I am using auto increment value for the inserts in my table. But is there any other way to generate a unique value (which is small enough and not GUID or UUID) in php to insert as primary key in mysql? Basically I want to get the value that is used as PK, but using auto increment I guess I
Formulas to Calculate Geo Proximity
I need to implement a Geo proximity search in my application but I’m very confused regarding the correct formula to use. After some searches in the Web and in StackOverflow I found that the solutions are: Use the Haversine Formula Use the Great-Circle Distance Formula Use a Spatial Search Engine in the …