mysql

Weird mysql error, not accepting variants of word 'select' when inserting / updating

I have a couple of textarea fields, which get saved into the database as text. If the textarea input has a select, selected or selecting in it, the query fails. I've never encountered this before. Am I doing something wrong? Here's the update query code as an example: $Query = "UPDATE project SET status = '".mysql_real_escape_string($_...

php:Data can posting but can't insert to DB.

dear all,this is my code at xampp: $sql = "INSERT INTO oqc_defect "; $sql.= "(Problem_date, Dept_found, Line, Shift, Time_found, Model, Serial_number, DIC, "; $sql.= "Def_class, Reject_qty, Symptom, Cause, Correction, Corr_action_pla...

how to retrieve table name from database in mysql?

i want to retrieve table name from database plz suggest me query. i am using phpmyadmin database. ...

Database architecture for millions of new rows per day

I need to implement a custom-developed web analytics service for large number of websites. The key entities here are: Website Visitor Each unique visitor will have have a single row in the database with information like landing page, time of day, OS, Browser, referrer, IP, etc. I will need to do aggregated queries on this database s...

Order by date and time

I have two varchar fields which store the date and time in the following format: date=2010-08-18; time=07:53:55; What would be the right sql query to show me the events from the most recent to the oldest ...

which is the best CMS solution for PHP mysql

which is the best CMS solution for PHP mysql ...

PHP and Quotations

I am always unsure, and I find myself playing around with it a lot. Is this proper? $game_name = "poker"; (Included from Config.php) $game_name_lower = strtolower($game_name); $sql = "SELECT * FROM `winners` WHERE `game` = '$game_name_lower'"; ...

Time tracking like Expert rating tests

Hi Experts, I am trying to create an Online Quiz script like expert rating test on ODesk or Elance. I want to track the time, means how much time have passed and left. I also want to stop the time counter, if the user internet connection is disconnected, so that he can start from where it was disconnected. One last thing how to disabl...

Mysql query staying in 'SENDING DATA' state for long time when using LEFT JOIN

I have query which is going in the SENDING DATA state for very long period of time. Can someone please help me with this : below are details Mysql Query: select a.msgId,a.senderId,a.destination,a.inTime,a.status as InStatus,b.status as SubStatus,c.deliverTime,substr(c.receipt,82,7) as DlvStatus from inserted_history a left join...

symfony database access configuration problem

Hi all, I just joined a web dev project that uses Symfony 1.4 on CentOS 5.4 with MySQL. The server is down. My first task in the project is to get it back up. I don't know a lot about Symfony. The Apache server log says Access denied for user 'root'@'localhost' (using password: NO) From all I can tell, the database access configuratio...

MySQL: what is the best way to create access system?

I have table called page which represents every single page in my website. page_id | page_subject | page_path ---------------------------------- 1 | Foo | /Foo 2 | Bar | /Bar I also have table called group: group_id | group_name --------------------- 1 | Users 2 | Admins Goal: how to def...

MySQL query help with grouping and adding

I have a table called user_logins which tracks user logins into the system. It has three columns, login_id, user_id, and login_time login_id(INT) | user_id(INT) | login_time(TIMESTAMP) ------------------------------------------------------ 1 | 4 | 2010-8-14 08:54:36 1 | 9 | 2010-8-16 08:...

java c3p0: how can i configure autoreconnect=true ?

Hello. I'm writing a red5 application using Java and I'm using the c3p0 for the database interaction. It seems that after the connection as timed out in my MySQL server my application stops working with a suggestion to configure autoreconnect=true. how can i do so? this is the function that i use to create datasource: private ComboPo...

Mysql is clipping the last character off password regardless

Hello I am using a salted sha1 string to store activation strings. PHP is generating the strings correctly, but I have a problem storing them. Using varchar or char and field length from 64 up to 180, mysql is removing the last character regardless. Does anyone know why that would happen? edit: CREATE TABLE `users` ( `id` int(6) NO...

MySQL Stored Procedures

Hi, I have a few questions regarding stored procedures. After hours of googling, I really can't find any really simple query examples. CREATE PROCEDURE test1(IN uid INT) BEGIN SELECT USER_NAME FROM USERS WHERE USER_ID = uid; END // this query takes 'uid' as input and selects the username for that uid, Can someone please explain h...

Building QT4 MySQL Drivers with MinGW

Hi, i need to make, qmysql.dll. I am referring to http://www.jiggerjuice.net/software/qt-sql-drivers.html # cd c:\mysql\lib\opt # reimp -d libmysql.lib # dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a the output file libmysql.a is a 0 kb file. what do i do to get a non zero kb file. Brgds, k...

How bad is using SELECT MAX(id) in MYSQL instead of mysql_insert_id() in PHP?

Hi, Background: I'm working on a system where the developers seem to be using a function which executes a MYSQL query like "SELECT MAX(id) AS id FROM TABLE" whenever they need to get the id of the LAST inserted row (the table having an auto_increment column). I know this is a horrible practice (because concurrent requests will mess the...

MYSQL: Cannot add or update a child row: a foreign key constraint fails

I am getting the error: Cannot add or update a child row: a foreign key constraint fails (mydb/requests, CONSTRAINT requests_ibfk_5 FOREIGN KEY (fixture_id) REFERENCES fixtures (fix_id) ON UPDATE CASCADE ON DELETE CASCADE) I have the following table structure: CREATE TABLE IF NOT EXISTS `requests` ( `request_id` int(11) unsigned NOT...

How to select from database with relations?

Hi, I have database with schema on picture below and I need to select everything related to one row (one id) of [letaky]. That means the related [zamestnanci], every related [obsah] and every [knihy] in it. This is the first time i used relations in database and i have no idea how to make such a select. ...

MySQL - Find Client with most transactions on a table

I have a table of transactions that stores the transaction id, the client id and the total amount of each transaction. How do I find the client with more transactions? Im using PHP and Mysql, but im sure there is a way to do this inside the SQL query. Thanks. ...