Skip to content

Tag: mysql

How to change the database connection in YII

I have yii application,, and i want to change the database connection.. first, my app is connect to ‘trackstar’ database, and later i want to change to ‘taskmanagement’ database.. So i just simply change the dbname in my code : but when i run the app i got error : CDbCommand failed to …

Need a script File to clear Cache Tables in a Drupal Database

I need to take a dump of MySQL Database, i usaully do these manual steps do Perform dumping.     login to phpmyadmin     select database     select sql tab     paste these lines         TRUNCATE watchdog;         TRUNCATE cache; and         TRUNCATE cache_admin_menu; And click on OK to clean the cache. I need…

foreach slider only shows one db entry

I’ve got an array which gets all the testimonials from the database table and displays them via a foreach array. I want some kind of a slider which fades-in and fades-out the results. This is my query: My PHP foreach code: My piece of Javascript code It’s currently only showing ONE (the latest in …

INSERT INTO two different tables, but have the same ID?

I have a database of Users and another table for Teachers. Teachers have all the properties as a user but also an e-mail address. When inserting into the DB how can I insert the info, ensuring that the ID is the same for both? the ID currently is on automatic incrament. this is what I have at the moment: than…

HTML and PHP in one file

I’m a PHP newbie trying to sort some basics out. I have a user-form that leads to a mysql select query, which works fine. Every tutorial I have found so far has the standard form tag, ie: action=’script.php’ method=’post’. This obviously opens script.php in a new tab/window thoug…

Insert DATA into 2 tables using one Query using PHP and Mysql

I have 2 tables that I am trying to insert data into using PHP wine_id is auto incremented, then This is my other table For the STOCK table I have stock ID as Auto incremented and wine_id is foreign-key so All i need to insert is quantity. I have a syntax like this: If there is another way to do