Problem with latest solaris 8 binary distribution?
The tarball seems to be missing libmysqlclient.so, I can get the database server started fine, and can connect to it using client applications. However, any attempt at using the dynamic client libs fails for obvious reasons. Am I missing something? Maybe downloading the wrong tarball? Or do I need to install from source? Thanks, Javier - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
PHP + MySQL problem (strange behavior)
Hello, I'm having trouble determining what's going wrong with a MySQL query that I'm doing from PHP. I have a table with the following columns: id (int) name (varchar 20) starttime (int) duration (int) now, i have a row that has a starttime of 60, when i attempt to do the following update with PHP, it sets it to 0: UPDATE mytable SET starttime=starttime-30 WHERE name = 'myname' but when I run it from the MySQL command line, copy/pasted from the code, it sets the value of starttime to 30 as expected. Any thoughts on where this problem originates from? PHP or MySQL? They're pretty commonly used in unison so I'd imagine something like this should work fairly smoothly. I've also posted this to the PHP list in case there's someone there that's encountered this before. Javier Muniz Chief Technology Officer Granicus, LTD. Tel: (415) 522-5216 Fax: (415) 522-5215 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: :mysql
You must have at least the mysql client libraries installed to use DBD::mysql. -jm -Original Message- From: John Tsangaris [mailto:[EMAIL PROTECTED]] Sent: Monday, March 05, 2001 1:36 PM To: mysql Subject: DBD::mysql I am trying to install DBD::mysql on a server which does not have mysql on it. ( The script will be accessing a mysql database on another server). The problem is, when I try to install dbd::mysql I am asked several questions.. one of which being: what is the path to mysql? I don't have a path to mysql as it is not installed and I don't want to install it. Is there a way to install DBD::mysql without having to install mysql? John - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: seemingly anomalous behaviour in Selects entered manually vs. in a script
What are you intending to do with $peek? You only use it once and it's sucking up one of your rows. -jm -Original Message- From: Warren [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 5:33 PM To: [EMAIL PROTECTED] Subject: seemingly anomalous behaviour in Selects entered manually vs. in a script Hi! I've got this seemingly anomalous situation that occurs when using a SELECT. If I use the MYSQL command line thing and SELECT * FROM QUESTIONS, it tells me that there are 7 rows in the set. There are, in fact 7 rows. Perfect. HOWEVER, if I execute the following script I always get 1 row fewer than exist. If there ought to be only 1 row in the result I get nothing displayed! SNIP ?php MYSQL_CONNECT("localhost","yourID","yourPASSWORD"); mysql_select_db("yourDATABASE"); $ex=@MYSQL_QUERY("select * from questions where uid='1' "); echo 'table width="95%" border="1" cellspacing="4" cellpadding="4" align="center" bgcolor="#CC" bordercolorlight="#FF" bordercolordark="#99"'; echo "form action=\"integrateTest.php3\" method=\"GET\""; //THE NEXT TWO LINES -- TRY EXECUTING ONE SELECT AND THEN COMMENT THE OTHER LINE AND EXECUTE THE OTHER SELECT //$ex=@MYSQL_QUERY("select * from questions where uid='1' "); $ex=@MYSQL_QUERY("select * from questions "); $peek=@mysql_fetch_row($ex); while($row = mysql_fetch_array($ex)) { $var=$row["uid"]; echo "tr tddiv align=\"left\""; echo "bselect: /binput type='checkbox' name='ID[]' value='$var'"; echo "/b/div div align=\"left\"bQuestion:/b $row[question]/div/td /tr"; } echo "/table"; echo ' p align=centerinput type="submit" name="Submit" value="Create Test" /form/p'; ? SNIP I suspect that it is something ridiculous that I am doing (or not doing), but I just don't see it. Would someone mind setting me straight on what I'm not doing correctly? Thanks heaps! -Warren - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Display information
select id,lot_id,lot_type from scrap_table where id = 1932 order by id limit 10; select id,lot_id,lot_type from scrap_table order by id limit 1932,10; either should work, i think the first would be faster but I'm not positive how MySQL would handle the second in terms of optimization. -jm -Original Message- From: Ron Beck [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 8:23 AM To: [EMAIL PROTECTED] Subject: Display information Hello all, I have a database with a little over 2000 records. I want to be able to construct a query that says something like this... select id,lot_id,lot_type from scrap_table starting with record 1932 (part I need help with) order by id limit 10; which should give me records 1932 - 1942 like this... +--+--+--+ | id | lot_id | lot_type | +--+--+--+ | 1942 | 0034906 | F| | 1941 | 0100308 | F| | 1940 | 0036309 | S| | 1939 | 0033503 | F| | 1938 | 0034108E | D| | 1937 | 0034712 | F| | 1936 | 0029404 | F| | 1935 | 0032706 | F| | 1934 | 0029404 | F| | 1933 | 0100307 | F| | 1932 | 0100404 | F| +--+--+--+ any suggestions? Ron - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: AND on a many to many table, with arbitrary ANDs
I don't think that solves his problem, since he wants to know AND, not OR... the closest thing I could get to was using select into... although it seems like it might be possible with a left join, i just can't figure out how. one of the things that I thought of with select into was to select count and the story name from the story,category, and storycategories join on their respective ids, then used IN ('Classics','Childrens') and grouped by story, yielding something like: Peter Pan | 2 Alice in Wonderland | 2 Pokemon | 1 War and Peace | 1 Tale of Two Cities | 1 then selecting from that subset for count = 2; if anyone can think of a way to do it with left joins, or a way to do it without select into, i'd be very curious to see the solution :0 cheers, Javier -Original Message- From: Rus [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 31, 2001 2:11 AM To: [EMAIL PROTECTED] Subject: Re: AND on a many to many table, with arbitrary ANDs I think you could use 'WHERE catid IN' For example, on PHP $catlist="1,2,3,4,5"; ... select ... where ... catid in ($catlist) And of course you should use category id in web form instead category name. - Original Message - From: Beasley, Julien [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 31, 2001 7:50 AM Subject: AND on a many to many table, with arbitrary ANDs Hello everyone, I am in the process of building a search engine on a database. I have two tables that have a many-to-many relationship: A story table and a category table. Story Table: --- id | story| --- 1 | Alice in Wonderland 2 | Peter Pan 3 | Pokemon's adventure 4 | Tale of Two cities 5 | War and Peace ..etc.. Category Table: -- id | category| -- 1 | Children 2 | Classics 3 | Tolstoy ..etc.. ` Storycategories Table: -- storyid | catid | - 1 | 1 1 | 2 2 | 1 2 | 2 3 | 1 4 | 2 5 | 2 5 | 3 ..etc.. From my (admittedly dim) understanding of SQL, this is how one is supposed to organize a many-to-many relationship. So peter pan is listed as 1 (childrens) and 2 (classics). I am writing a web interface to do searches for stories. In my web interface, you have something like this: --- []Classics []Childrens []Tolstoy []Fiction ... Search Categories: (x) match all categories ( ) match any category --- In order to build a query that matches ALL categories, I use aliasing. To do a search on stories that are Children AND Classics, I make two instances of each table as shown in the example below. select S.story from stories_tbl S, categories_tbl C1, storycategories_tbl O1, categories_tbl C2, storycategories_tbl O2 where S.id = O1.storyid and O1.catid = C1.id and C1.category like "Children" and S.id = O2.storyid and O2.catid = C2.id and C2.category like "Classic" group by story This query works fine. My problem arises when I have many categories to choose from. If I check many of the categories boxes, and select match all categories, my program builds a query with a large amount of tables, I get an error like this: Error 1116: Too many tables. MySQL can only use 32 tables in a join My guess is that there is a limit of 32 tables in a join, and that my use of aliasing here ends up violating the 32 table limit. Even worse is when I make a query that has a little less than 32 tables. This won't give an error, but will leave a process running on the machine that consumes 100% cpu. After a while, this process will render the database unusable, and no one can use the database until the process is killed! So to clarify, the query that ends up being built looks like this: select S.story from stories_tbl S, categories_tbl C1, storycategories_tbl O1, categories_tbl C2, storycategories_tbl O2 categories_tbl Cn, storycategories_tbl On where S.id = O1.storyid and O1.catid = C1.id and C1.category like "Children" and S.id = O2.storyid and O2.catid = C2.id and C2.category like "Classic" ... S.id = On.storyid and On.catid = Cn.id and Cn.category like "" group by story This query fails when "n" is around 16. My question is, how can I build a query that will support an arbitrary number of ANDs on a many to many relationship? I'd like to be able to do a search on stories that are "Children AND Classics AND Tolstoy AND Category N" where N is fairly large (hundred or so).. Is there any way to do this? Am I using aliasing incorrectly? Those of you that have made it in reading this far, thank you :). I appreciate your attention and any assistance
Mangled queries
Has anyone else experienced a problem in which queries get mangled (using mysql 3.23.30 for both client and server, client is on redhat 6.2, server is on solaris 2.7)? It appears to happen only for one query in particular (posted below). select parts.part_code,parts.price,parts.name FROM parts,part_map WHERE parts.part_code = part_map.part_code AND part_map.sys_id = 'G1200SCA' AND parts.type = 'floppy' ORDER BY part_code; Half the time I run this query, it works. the other half, the query appears to be mangled. Examples of error messages I've received: ERROR 1109: Unknown table 'partnic' in where clause or ERROR 1064: You have an error in your SQL syntax near ':?d,sys_id = 'G1200SCA' AND part ... at line 1 If I change 'floppy' to 'cdrom' or anything else in the database, the query seems to work fine. I'm running these queries from the MySQL client and from PHP 4.0.4pl1, and both appear to be exibiting the same problem. I haven't ruled out a problem with RedHat's libraries at this point, and I'm currently looking through mailling lists on their site. If anyone's seen this problem or heard of something, please let me know as I'd really like to get this fixed. Cheers, Javier - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php