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
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',
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
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
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
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
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
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
--- 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
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
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
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
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
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:
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
--- 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 @
Why is the following query retuning doctypes 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.
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,
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
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
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 =
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
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
]=
]= 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
]=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.
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
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
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
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
29 matches
Mail list logo