Skip to content

Tag: mysql

Function to count MySQL rows using WHERE

am making function to count rows using “WHERE”, but i get a mysql error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:AppServwwwtesttestindex.php on line 9 Unknown column ‘1’ in ‘where clause’ here is my function i’ve created t…

Command-line script PHP does not run

I am trying to build a PHP script to process data manually to later convert it to a cronjob. This script also gets data from MySQL and a third-party SOAP interface. When I try to run it from the command line I have an error and the script does not run. It shows: Here’s what I have in my script:

select max codeigniter

Im trying to get an max value with codeigniter from an table but it isnt working. This is the error i get: Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string Filename: database/DB_active_rec.php Line Number: 427 This is my function: What im trying to do is as followed:…

selecting unique values from a column

I have a MySQL table which contains the following type of information: Here is an example of a script I use to get data from this table: This script displays every date from the table, e.g. I would like to only display unique dates, e.g. Answer Use the DISTINCT operator in MySQL: