mysql

mysql query, two select

Hi, As soon as I apologize because I do not know or be able to explain exactly trouble. How get value from table user_address. how to pass user ID in the second "select". select id, name, age, (select address from user_address where user_id = ??user.id ORDER BY address_name LIMIT 1) AS address from user ...

MySQL query results are not a resource

I am having trouble with the query in this code. The problem is one I have had before, the $num = mysql_num_rows($result); part gives me a MySQL error saying it expected a resource. Usually when I have this error it is because I misplaced a single quote some where, but after looking I cannot find any problem, though this query is a bit...

Maximum length for MD5 encryption

What is the maximum length of the string that can have md5 encription or Is it has no limit, and if so what will be the max lendth of the md5 encripted value? ...

mysql, use two select

hi, why i get error: Subquery returns more than 1 row SELECT name, cat_id, ( SELECT topic FROM category WHERE cat = u.cat_id ) AS topics FROM name u Thanks ...

need updation for mysql query for choosing date range for reservation of a hotel room or any thing

Hi every one, i had a situation in my project that is as follows. while checking for the available rooms $sel_from_bookings="SELECT room_no FROM `booking` WHERE (('".$_POST['req_tdate']."' BETWEEN check_indate AND check_outdate) OR ('".$_POST['req_fdate']."' BETWEEN check_indate AND check_outdate)"; $sel_from_reserv="SELECT room_no ...

DataSet and XmlDataDocument

What is the importance of using XMlDataDocument with dataset. It is getting me bit confused Can some one please explain the importance of this? thanks ...

mysql select static list

I want to run an INSERT ... SELECT Manual query to insert 1 selected column column with the exact amount of 2 rows from one table to another. Along with this I would like to insert an additional column of static values. Example | selected column | static val | Variable 4 Variable 9 sta...

How to merge 2 rows in mysql

T1 F1 F2 F3 F4 a 2 2 NULL a 2 3 UK But i want only the result is a 2 2,3 UK if i do select How to achieve this ? i am looking out the result :a 2 2,3 UK and 2,3 is F3 field ...

MySQL - Stored procedure with multiple result sets

Am using two select statements in a stored procedure but it is returning only single select statement table,how to get the both tables record set please suggest me? ...

Index counter shared by multiple tables in mysql

I have two tables, each one has a primary ID column as key. I want the two tables to share one increasing key counter. For example, when the two tables are empty, and counter = 1. When record A is about to be inserted to table 1, its ID will be 1 and the counter will be increased to 2. When record B is about to be inserted to table 2, i...

Hosting CakePHP app with Amazon Web Services (EC2, etc.)?

Hello all, I don't think I fully understand Amazon Web Services yet, which is why I'm asking this question. I want to know if AWS would be a nice host for a CakePHP application that of course runs off PHP, and MySQL? Would I have to change or add anything to my code if used a service like EC2? I also noticed that Amazon has it's own da...

MySQL request WHERE ... IN ...

Hi, in a table "partners", i've a field "sites" which can contain values like 1,27,38,12 then, in a website which has ID n°27, i would like to get partners associated to this website. I tried this : SELECT * FROM partners WHERE 27 IN (partners.sites) It works if 27 is at the beginning of the string (eg: 27,1,128) but it doesn't wor...

Can i have LINEFEED as separator in CONCAT_WS function of mySQL

I am using a mySQL CONCAT_WS() function to get a set of comma separated values. I need the output to appear as a set of rows instead of a CSV. How can this be done ? Thanks, Chak. ...

What is your opinion on using textual identifiers in table columns when approaching the database with normalization and scalability in mind?

Which table structure is considered better normalized ? for example Note: idType tells on which thing the comment has taken place on, and the subjectid is the id of the item the comment has taken place on. useing idType the textually named identifier for the subjectid. commentid ---- subjectid ----- idType --------------------------...

raise error in mysql

Possible Duplicate: raise error within MySql function how to achive raiseerror functionality in MySql? ...

Сreate trigger in MySQL or not (via PHP)?

Table in MySQL have 1 problem column: creation_date. During inserting a new row through PHP, I thought that there would be correct to insert the date directly in the query, MySQL has to do it himself. Do I need to do the trigger, or it would be better to use PHP for this, as intended? How would you have done to? PS: http://stackoverfl...

MySQL LIKE clause with comma

What is the meaning of comma in the following SQL statement (using MySQL)? [...] LIKE '%,cat233,%' ...

FIND_IN_SET question or..

Hello. Anyone could help me with a mysql Question? I have a row with a list of items, eg: '1','2','3','4','5','6','7','8','9' .. sets of 3 elements.. from 3 to 3.. Now how could i search into this with FIND_IN_SET above '4' and return from what sets it is. In that case, to tell me that is from set 2 SELECT FIND_IN_SET('''4''', REPLACE(`...

IIS7 ASP classic Mysql and ODBC Driver problems

We have just moved our high volume ASP classic website from Windows server 2003, 32bit, iis6, Mysql to server 2008, 64bit, IIS7. We are experiance some truncated data and page slow downs on some pages that make a lot of calls on the DB. We are using ODBC Driver 3.51. We are pretty sure it is the ODBC driver but have no idea how to fix...

PHP Query Generator/Reporter

I'm in the process of tweaking a web application and so far I've had some really helpful guys from here, explaining things in layman's terms. Thank you. One of the abilities I wanted in my app was the ability to search through records and use the result to generate different kinds of useful reports. In my workplace we use a system like ...