mysql

DB Efficiency , php application

Hi there, after getting my answer here: http://stackoverflow.com/questions/3537288/database-issue-how-to-store-changing-data-structure i have another question. lets say i have a workout: first set: 60 push ups second set : 55 push ups third set: 50 push ups firth set: 45 push ups and so on.. I think it would be a waste to make an e...

Trying to generate tables from Doctrine models and getting MySQL errors

Doctrine_Core::createTablesFromModels() is failing with the following error: Fatal error: Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'newmexicocreates.address_type' doesn't exist. Failing Query: "SELECT a.id AS a__id, a.title AS a__title FROM address_...

retrieve Mysql server time using ADO.net

I am using ADO.net and LINQ-to-Entities in VS2010 to connect to Mysql server, and I would like to know what is the current date and time on the server side. Is there any method to do this using a LINQ query? I don't want to use any SQL statements in my program. ...

php & mysql converting non- to unicode

I have characters like these on our web site: Fémnyomó That is a street address, entered in another language (though I do not know which). Here's the db setup: mysql 4.1.2log charset cp1252 West European (latin1) I'm using PHP but without mbstrings() (though I do no string conversions on this address, just echo). If I changed...

Optimize this query, retrieve users from a MySQL db with 500.000 users and one conditional

Suposse I have the next MySQL database with 500.000 rows: users { id - int, name - varchar(32), verified - tinyint(1) } primary { id } index { verified } And I need to get last 20 not verified users, so I use the next query: SELECT * FROM users WHERE verified != 1 ORDER BY id DESC LIMIT 20 But it takes 1...

Need help with a MySQL query

Please help me with this MySQL query. I've been on it for long enough. Perhaps it needs a fresh pair of eyes. Two tables: locks and sessions locks -------------- id session_id -------------- 1 sajf4$Jf9422jd 2 2jf*4j2okg9092 3 J8j4j4ffss93o2 ------------------ sessions ------------------------- id user_id -------------...

What's the difference between Oracle and Mysql when interpreting "Create Database " ?

I used to use mysql, and in mysql database hold tables, but these concepts doesn't apply to oracle, so I don't quite understand the differences. Update: The problem I am facing is, I need to do migration from Mysql to Oracle. I have two switching databases called A and B, in Mysql all the tables are in their corresponding databases. I...

Is it possible to list MySQL Server closed connections?

To list active connections we do: show processlist; What to do to list old closed connections? ...

Random ids between limit IDs using RAND() php msql

hi anyone know about how to use Random wallpaperid between limit IDs using RAND() php msql i use this but its RAND() whole database $sql_wallpaper = "SELECT * FROM wallpaper WHERE RAND()>0.9 ORDER BY RAND() LIMIT 0,5"; $res_wallpaper = mysql_query($sql_wallpaper); reply please ...

problem when insert "\\" in MySQL table

when i insert a specific value in MySQL table through code i get exception (1064 error) i know the reason , but i don't know how to fix the problem,, all what i wanna to do is to store the relative path of my images in the image table then i get this exception all the time when the inserted string contains "\" or @"\". how can i fix th...

PHP & MySQL question.

I was wondering how can I check a value from an array to see if its in the database if it is don't added to the database again. How would I be able to do this using PHP & MySQL? PHP code. for ($x = 0; $x < count($cat_id); $x++){ $cat_query = "INSERT INTO posts_categories (category_id, post_id, date_created) VALUES ('" . mysqli_real...

Can I enter formula in the column for MySQL database?

I wonder if the above can operate the column like the excel. eg. same row. column 1 : A, column 2 : b, column 3 : A + b. ...

MySQL database: lua or python

Under preferences(Menu)/general (Tab)/ Interactive GRT Shell Language: lua or python. What is the difference? I use MyQSL for database and involve mostly binary. ...

Which DBMSs offer index-organized tables?

My current knowledge: Oracle does offer index-organized tables and defaults to heap-organized. I heard that SQL-Server uses only index-organized tables I am especially interested in answers for MySQL, Informix and DB2. ...

Need help with SQL ORDER BY

I have a table of contacts which has name and default_name columns among others. Contact name is name, unless name=NULL and then it is default_name (which cannot be NULL). I would like to order my selection by contact name. For example: contact_id name default_name ---------- ---- ------------ ...

Update MySQL Value Through Img Src Variable Including jQuery

Thank-you to all who have helped me over the last few days.. Unfortunately I was working so I couldn't get back to you. I have included some code into what I thought would work, but for some reason the below code will not update in my SQL Database. I will provide the code and it's output if someone could please copy the code and see wh...

Stackoverflows Tags system, How To

OK so now I can understand that SO's search system is primarily based around tags, the tag system they use is a very good one at that but what I want to do is replicate it for my own projects. Now I can understand how to use foreign keys and such, but I'm not exactly sure how it's been developed here, do they use 3 tables or 2 etc. How...

Find last alphanumeric value in mysql

I have a field that contains usernames in a mysql db eg: johndoe2 johndoe10 johndoe3 If i order by that field DESC I get: johndoe3 johndoe2 johndoe10 I need to get: johndoe10 johndoe3 johndoe2 Any help appreciated ...

Unknown column 'xyz' in 'where clause'

i created a user defined sql query that doesn't work. users are supposed to be able to enter search strings in an input field, submit then see the results of their search but everytime i enter a search for something that i know is in the database i get the unknown column "x" in "where clause" error message. would you please help me fix...

What causes ArgumentOutOfRangeException on SqlConnection.Open()?

In trying to write a simple C# ADO.NET application to connect to my database and manage project entries for my website, I've run into a strange problem that I can not find any information regarding. I've verified that my MySQL server is accepting remote connections, listening on port 3306, the username provided is valid, as is the passwo...