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…
Tag: mysql
Convert latin1 characters on a UTF8 table into UTF8
Only today I realized that I was missing this in my PHP scripts: All my tables are InnoDB, collation “utf8_unicode_ci”, and all my VARCHAR columns are “utf8_unicode_ci” as well. I have mb_internal_encoding(‘UTF-8’); on my PHP scripts, and all my PHP files are encoded as UTF…
Sanitize $_SERVER[‘HTTP_USER_AGENT’] & $_SERVER[‘HTTP_REFERER’] before saving to DB?
I have a feedback form which will take a couple of user inputted fields along with a few fields generated by PHP functions like ‘user-agent’ and ‘referer.’ My question is should these strings be sanitized before being inputted? I realize one could easily alter the user-agent and the re…
Fatal error: Call to undefined function getsqlvaluestring()
Hey guys I get this error when I try to login with a default Dreamweaver Login Module, please help me – this is a though one, I’m just an html designer trying to make a simple login script for a small site I’m working one. It’s be great if you can help Sorry guys, the error is Fatal er…
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:
PHP/MySQL web-app Internationalization with enum DB fields
I have joined a project recently and now I’m working on its Internationalization improvement. Technologies used are PHP/MySQL/Zend Framework/Dojo. I18n is implemented using gettext almost as described …
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:
Systematic way to store pictures for social website [closed]
I’m building a basic social website where users can upload pictures. I’m going to store store the images on the file system. When a user uploads a picture, how do you think I should name the files? I …
Registration script, need a database input to be checked then deleted upon register
I have a problem with my script. What it is supposed to do is that when a user register with the form, it should insert it, but only if the “passkey” matches the one that is in a different table that I set. After it has been verified it should insert the user info to the database, and then delete