Merging 2 Fields

2004-06-27 Thread David Blomstrom
I think I recall a thread where someone mentioned merging two fields. If that can be done, I'd like to know how. For example, suppose I have a field filled with place names, next to a field filled with links: California | http://www.california.gov/ Florida | http://www.florida.gov/ I'd like to

RE: Merging 2 Fields

2004-06-27 Thread David Rodman
You mean something like this? mysql create table nads( - state varchar(50), - url varchar(100)); Query OK, 0 rows affected (0.03 sec) mysql insert into nads values('California', 'http://www.california.gov'); Query OK, 1 row affected (0.00 sec) mysql insert into nads values('Florida',

AW: Merging 2 Fields

2004-06-27 Thread Freddie Sorensen
David, Maybe the CONCAT() function is what you are looking for ? Freddie -Ursprüngliche Nachricht- Von: David Blomstrom [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 27. Juni 2004 08:07 An: [EMAIL PROTECTED] Betreff: Merging 2 Fields I think I recall a thread where someone

Re: Merging 2 Fields

2004-06-27 Thread Michael Stassen
Don't forgot the quotes around the URL: SELECT CONCAT('A HREF=', url, '', state, '/A') AS link FROM nads; Michael David Rodman wrote: You mean something like this? mysql create table nads( - state varchar(50), - url varchar(100)); Query OK, 0 rows affected (0.03 sec) mysql insert into nads

Re: Question

2004-06-27 Thread Michael Stassen
It's hard to say without more information. We could speculate that you did something wrong or there's a bug in your copy of mysql, but it would be just that, speculation. What version of mysql are you using? On what platform/OS? Is that the exact query, or a simplified representative? What

Re: Question

2004-06-27 Thread Robert J Taylor
On Sat, 26 Jun 2004 22:19:02 +0200, Schalk [EMAIL PROTECTED] wrote: Why is the following query retuning doctype's different to what is asked for? SELECT * FROM documents WHERE jstate = 'California: State Court' AND doctype = 'Verdict' Any ideas? What is being returned? Not knowing what it is

Re: DELETE doesn't delete?

2004-06-27 Thread Michael Stassen
Have you verified that the SQL statement sent by PHP is what you expect? If not, I would suggest you load the query into a string, then print the string as part of your output in addition to passing it to mysql_query(). In my own coding, I have several times spotted errors this way in the

Re: insert into text field

2004-06-27 Thread Eric Bergen
desc is a reserved word. http://dev.mysql.com/doc/mysql/en/Reserved_words.html In most cases to use desc as a column you will have to escape it with backticks like this `desc`. -Eric On Sat, 26 Jun 2004 16:19:37 +0530, Nitin [EMAIL PROTECTED] wrote: Hi all, There's a problem. When I try

RE: Merging 2 Fields

2004-06-27 Thread David Blomstrom
--- David Rodman [EMAIL PROTECTED] wrote: You mean something like this? mysql create table nads( - state varchar(50), - url varchar(100)); Query OK, 0 rows affected (0.03 sec) OK, you're creating a table named nads, with fields named state and url, right? mysql insert into nads

Flowing Text Into Multiple Columns

2004-06-27 Thread David Blomstrom
Suppose I want to display an entire field, but not in one long column. Instead, I want to flow it evenly into several columns. For example, consider the following column: Alabama Alaska Arizona Arkansas California Colorado Connecticut I might want to split it into two columns: Alabama

Re: MySQL from Python Error

2004-06-27 Thread Michael Stassen
I've not used Python, but it looks like the query has invalid syntax once it gets to mysql. The last error line is the key: 1064, You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '139.80'' WHERE

Re: Merging 2 Fields

2004-06-27 Thread Michael Stassen
David Blomstrom wrote: --- David Rodman [EMAIL PROTECTED] wrote: You mean something like this? mysql create table nads( - state varchar(50), - url varchar(100)); Query OK, 0 rows affected (0.03 sec) OK, you're creating a table named nads, with fields named state and url, right? Yes. As an

Re: MySQL from Python Error

2004-06-27 Thread Paul DuBois
At 19:08 -0700 6/26/04, Paul Maine wrote: I encountered the following error when trying to perform a SQL UPDATE to a MySQL database table from Python. I would apprciate any assistance. In the Python code I have tried integer and decimal format specifiers in addition to the string specifier and

Database Connection Questions

2004-06-27 Thread David Blomstrom
I'm previewing local pages with a database connection that looks something like this: @mysql_connect (localhost , USERNAME , PASSWORD); @mysql_select_db (DATABASE); I modified it for an online site and published it online. But when I preview a page, I get error messages like the following:

RE: Database Connection Questions

2004-06-27 Thread Peter Lovatt
hi the /home/lark/public_html/connection.php on line 23 just refers to the file within the context of the whole file system and is fine the rest says that mysql cannot/does not execute the query so there is no result to use. the @ suppresses error messages so it may be best to remove it try

RE: Database Connection Questions

2004-06-27 Thread David Blomstrom
--- Peter Lovatt [EMAIL PROTECTED] wrote: hi the /home/lark/public_html/connection.php on line 23 just refers to the file within the context of the whole file system and is fine the rest says that mysql cannot/does not execute the query so there is no result to use. the @

RE: Query problem

2004-06-27 Thread Schalk
Why is the following query retuning doctype’s different to what is asked for? SELECT * FROM documents WHERE jstate = 'California: State Court' AND doctype = 'Verdict'   Any ideas? As far as I can see it should only return a document if it is a Verdict and matches the state California: State Court.

REGEXP and word boundary match

2004-06-27 Thread Luke Majewski
Hi All, I have fields like: Washable Velour Doll in my database and I want to do a boundary match so that when people enter a search field like Velour I return all instances where the whole word exists. In other words, 'lour' would not work. I know that reg expressions have boundary matching,

Re: REGEXP and word boundary match

2004-06-27 Thread Paul DuBois
At 19:14 -0400 6/27/04, Luke Majewski wrote: Hi All, I have fields like: Washable Velour Doll in my database and I want to do a boundary match so that when people enter a search field like Velour I return all instances where the whole word exists. In other words, 'lour' would not work. I know

matching any values of a set to any values of another set

2004-06-27 Thread tidalx
Hi, i am trying to match a set of values to another set of values, and to return true if any of the values of one set matches any values of the second set. Something like SELECT * FROM listings WHERE FIND_IN_SET('Mastercard,Visa', 'AMEX, Cash, Mastercard, Visa') 0; which I don't think

Re: Query problem

2004-06-27 Thread Eric Bergen
Post the table structure, what that query it returning and what you think it should return. -Eric On Sun, 27 Jun 2004 23:33:55 +0200, Schalk [EMAIL PROTECTED] wrote: Why is the following query retuning doctype's different to what is asked for? SELECT * FROM documents WHERE jstate =

Re: REGEXP and word boundary match

2004-06-27 Thread Luke Majewski
Paul DuBois wrote: Why do you think this? That's not what the regex chapter in the MySQL manual says. \b works in Perl, but MySQL isn't Perl. I looked through the pattern matching section and didn't see what you linked below. The easiest way to find out the correct syntax is to look in the

WHERE field IN (SELECT stmt) not working

2004-06-27 Thread Oliver Chua
Sorry if this has been posted as a bug. I tried searching in the bug database but the word IN (which is the operative word here) is being ignored by the search engine... I'm using mysql-4.0.20a-win.zip. WHERE field IN (SELECT stmt) not working but WHERE field IN ('literal1', 'literal2' ) is

RE: Merging 2 Fields

2004-06-27 Thread David Rodman
]= ]= mysql insert into nads values('Florida', ]= 'http://www.florida.gov'); ]= Query OK, 1 row affected (0.00 sec) ]= ]=I'm a little confused here. I'm slightly more familiar ]=with manipulating PHP than MySQL. It looks like your ]=suggestion is a permanent fix. It just occurred to me ]=that it

RE: Flowing Text Into Multiple Columns

2004-06-27 Thread David Rodman
]=Suppose I want to display an entire field, but not in ]=one long column. Instead, I want to flow it evenly ]=into several columns. ]= You're looking for the wrong type of screwdriver to drive this particular nail. MySQL is not a text processor. This could be done fairly simply with PHP.

Re: INDEX DESC

2004-06-27 Thread Robert A. Rosenberg
At 15:30 -0400 on 06/23/2004, Michael Stassen wrote about Re: INDEX DESC: The manual http://dev.mysql.com/doc/mysql/en/CREATE_INDEX.html says An index_col_name specification can end with ASC or DESC. These keywords are allowed for future extensions for specifying ascending or descending index

Re: WHERE field IN (SELECT stmt) not working

2004-06-27 Thread Michael Stassen
It's not a bug. MySQL 4.0.20 does not support subqueries. You need 4.1 for that. You can probably rewrite your query as a JOIN, however. See the manual http://dev.mysql.com/doc/mysql/en/Rewriting_subqueries.html for some suggestions. Michael Oliver Chua wrote: Sorry if this has been posted

Re: matching any values of a set to any values of another set

2004-06-27 Thread Michael Stassen
tidalx wrote: Hi, i am trying to match a set of values to another set of values, and to return true if any of the values of one set matches any values of the second set. Something like SELECT * FROM listings WHERE FIND_IN_SET('Mastercard,Visa', 'AMEX, Cash, Mastercard, Visa') 0; SELECT * FROM

Re: INDEX DESC

2004-06-27 Thread Robert A. Rosenberg
At 16:38 -0400 on 06/23/2004, Michael Stassen wrote about Re: INDEX DESC: For example, I want to read ranges of values from my db in the opposite order of how they are currently being indexed without using an extra ORDER BY in my select. This ORDER BY forces an internal sort to put the result