I am getting the lovely � box where spanish characters should be displayed. (ie: ñ, á, etc). I have already made sure that my meta http-equiv is set to utf-8: I have also made sure that the page header is set for utf-8 also: Here is the beginning stages of my code thus far: The above code is in a
Tag: mysql
Using isset() inside a foreach doesn’t work?
Basically, I have an indefinite number of buttons that I want to generate from variables held in the mysql database. Now when I try to press the buttons nothing happens. This is the code I thought might work for that: There are no errors. I think it’s because I can’t use isset inside a foreach thi…
Select from multiple tables with laravel fluent query builder
I’m re-writing some PHP/MySQL to work with Laravel. One thing I would like to do is make the DB queries more succinct with the Fluent Query Builder but I’m a bit lost: SELECT p.post_text, p….
How to create a custom JSON layout from MySQL in PHP
I have a MySQL query in PHP that pulls back two columns of results Column One is Label Column Two is Value I have read http://nitschinger.at/Handling-JSON-like-a-boss-in-PHP but im struggling to understand how I can do the following JSON in PHP from MySQL I can manually write a loop to output the raw text to …
PDO fetch / fetchAll
Not new to PHP, but only a day old to PDO. Surely I am doing something wrong here. the only way I can declare those $_SESSIONS properly is if I use $result[0][‘fieldName’]; How can I just access it via $result[‘fieldName’]; ? Answer fetchAll, as the documentation says, retrieves an arr…
MySQL error with Not unique table/alias with join
SELECT `idstudii` FROM (`studii`) JOIN `studii` ON `mesaje`.`idstudii`=`studii`.`id` JOIN `users` ON `users`.`id`=`studii`.`idusers` WHERE `studii`.`idusers` = ‘1’ I have this sql query which …
Undefined function mysql_connect()
I have ran aptitude install php5-mysql (and restarted MySQL/Apache 2), but I am still getting this error: Fatal error: Call to undefined function mysql_connect() in /home/validate.php on line 21 phpinfo() says the /etc/php5/apache2/conf.d/pdo_mysql.ini file has been parsed. Answer Well, this is your chance! I…
Database Driver MySQLi Error
I am running Moodle test environment on Window Vista having PHP 5.2.10 and MySQL 5.1.36-Community. When I upgrade from Moodle 1.9.9 to 2.0, I am getting the following error. I also tried to change the dbtype=’mysqli’ in config.ini and still see same error. I would really appreciate if you can prov…
PHP MySQL Insert Ignore Inserting Too Much Data
I have a traffic exchange and every time a site is viewed I want it to insert in to a table which looks like: -user -site The user is default of 1 and I don’t insert in to it because I thought for an INSERT IGNORE you need a column that stays in the same. My current query: I have
Auto fill text box depending on Drop Down value
This might be a stupid question but I would like to have a clarification on how to go about this. I have come across quite a few articles that let to set the values of a text box depending on the choices made in a drop down menu using jQuery and Ajax. My issue is when I’m trying to do