make vehicle licence the unique key
On 14 Oct 2015 00:28, "Karl DeSaulniers" wrote:
>
> Quick question. Is this viable in MySQL?
>
> UNIQUE KEY `Vehicle_Name`
(`Vehicle_Make`+`Vehicle_Model`+`Vehicle_Style`+`Vehicle_License`)
>
> TIA
>
> Best,
>
> Karl DeSaulniers
> Design
Quick question. Is this viable in MySQL?
UNIQUE KEY `Vehicle_Name`
(`Vehicle_Make`+`Vehicle_Model`+`Vehicle_Style`+`Vehicle_License`)
TIA
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com
instead of +, use ",'
2015-10-13 20:21 GMT-03:00 Karl DeSaulniers :
> Quick question. Is this viable in MySQL?
>
> UNIQUE KEY `Vehicle_Name`
> (`Vehicle_Make`+`Vehicle_Model`+`Vehicle_Style`+`Vehicle_License`)
>
> TIA
>
> Best,
>
> Karl DeSaulniers
> Design Drumm
>
Hello Everyone,
Hope your 2013 is treating you well.
Quick question and apologies if it is a stupid question.
Is this a viable syntax?
$sql = SELECT orderid
FROM ORDERS_TABLE
WHERE orderstatus = 'Cancelled' OR (orderstatus = ('New' OR
'Denied' OR 'Expired' OR 'Failed'
SELECT orderid
FROM ORDERS_TABLE
WHERE orderstatus IN ( 'Cancelled', 'New', 'Denied',
'Expired' , 'Failed' , 'Pending' , 'Refunded' , 'Reversed' , 'Under Review'
, 'Voided') AND orderdate '.mysqli_real_escape_string($
yesterday);
Another option would be to use
On Jan 15, 2013, at 5:25 AM, Amit Tandon wrote:
SELECT orderid
FROM ORDERS_TABLE
WHERE orderstatus IN ( 'Cancelled', 'New', 'Denied',
'Expired' , 'Failed' , 'Pending' , 'Refunded' , 'Reversed' , 'Under
Review'
, 'Voided') AND orderdate
Or something like this?
SELECT * FROM `Bible_trivia` WHERE answer=`answer`;
Then match the results to trivia_answer_1 in php to see if correct.
if($trivia_answer_1 == $results) {
... do this
}
or a switch
switch ($results) {
case $trivia_answer_1:
... do this
Heh,
Thanks Karthik. Not my post.. :)
But your solution looks dead on..
Here you go Ron. Try this one.
Best,
Karl
On Oct 13, 2011, at 2:42 AM, Karthik S wrote:
Try this,
select
CASE answer
when 1 then trivia_answer_1
when 2 then trivia_answer_2
when 3 then
In my Bible_Trivia table I have the columns
`trivia_answer_1`, `trivia_answer_2`, `trivia_answer_3`, `trivia_answer_4`,
`answer`
`answer` is an integer always with a value of 1 to 4. Is there a way to use the
value of `answer` to only select the correct trivia answer?
This doesn’t work, but
...@actsministries.org]
Sent: Wednesday, October 12, 2011 3:25 PM
To: php-db@lists.php.net
Subject: [PHP-DB] SELECT syntax
In my Bible_Trivia table I have the columns
`trivia_answer_1`, `trivia_answer_2`, `trivia_answer_3`, `trivia_answer_4`,
`answer`
`answer` is an integer always with a value of 1 to 4
Hi
In Oracle (and maybe others) you can use
select case
when answer=1
then trivia_answer_1
when answer=2
then trivia_answer_2
when answer=3
then trivia_answer_3
when answer=4
then trivia_answer_4
else null
end answer
from bible_trivia_table
OR
You can select all of them and process in PHP,
select casehttp://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html
works in mysql also
regds
amit
The difference between fiction and reality? Fiction has to make sense.
On Thu, Oct 13, 2011 at 3:26 AM, Jack van Zanen j...@vanzanen.com wrote:
Hi
In Oracle (and maybe
another
examplehttp://mysql-tips.blogspot.com/2005/04/mysql-select-case-example.html
regds
amit
The difference between fiction and reality? Fiction has to make sense.
On Thu, Oct 13, 2011 at 9:34 AM, Amit Tandon att...@gmail.com wrote:
select
Hello,
I have a query on a page that used to work fine, but is now generating an
error.
I assume that the version of php or mysql was updated on the webhost server
or something like that?
Here is the query:
select count(places_data.place_id) as areacount, boroughs.borough_name as
boroname,
you have renamed places_data table to 'a'
2011/1/13 Harvey har...@harveyk.com:
Hello,
I have a query on a page that used to work fine, but is now generating an
error.
I assume that the version of php or mysql was updated on the webhost server
or something like that?
Here is the query:
Thanks, I got it working now, had to use the a/b/c thing a few times
-Original Message-
From: jose [mailto:jojap...@gmail.com]
Sent: Thursday, January 13, 2011 9:52 AM
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Query syntax error?
you have renamed places_data table to 'a'
2011/1
Can anyone see something wrong with this syntax?
UPDATE `advertisements` INNER JOIN `advertisements_rate_plans` ON
`advertisements.rate_plan` = `advertisements_rate_plans.reference` SET
`advertisements.displayed` = 0 WHERE `advertisements.start_date` =
'2007-12-13' AND `advertisements.end_date` =
-Original Message-
From: Ron Piggott [mailto:[EMAIL PROTECTED]
Sent: Thu, December 13, 2007 7:20 PM
To: php-db@lists.php.net
Subject: [PHP-DB] UPDATE syntax
Can anyone see something wrong with this syntax?
UPDATE `advertisements` INNER JOIN `advertisements_rate_plans
-them are used to be
explicit with a name.
-TG
- Original Message -
From: Gary Wardell [EMAIL PROTECTED]
To: php-db@lists.php.net
Date: Thu, 13 Dec 2007 19:33:57 -0500
Subject: RE: [PHP-DB] UPDATE syntax
Hi,
I'm a beginner at PHP and MySql but a long time MS SQL server user.
Maybe
$query=SELECT * FROM table WHERE listing_type LIKE '%$listing_type%' AND
listing_approved = '1' OR listing_approved = '2' ORDER BY name ASC;
My question is how can I search for records where listing_approved has a
value of either 1 or 2 (while in the same search I am searching for
%'
AND listing_approved IN ('1', '2')
ORDER BY name ASC
Good luck!
-TG
- Original Message -
From: ron.php [EMAIL PROTECTED]
To: php-db@lists.php.net
Date: Sat, 15 Sep 2007 15:04:59 -0400
Subject: [PHP-DB] Query syntax
$query=SELECT * FROM table WHERE listing_type LIKE '%$listing_type
If I give this command through PHP to mySQL
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( Unable to select database);
$query = UPDATE `table` SET `last_activity_field` = '$current_date'
WHERE `reference` = '$account_reference' LIMIT 1;;
mysql_query($query);
Ron Piggott (PHP) wrote:
If I give this command through PHP to mySQL
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( Unable to select database);
$query = UPDATE `table` SET `last_activity_field` = '$current_date'
WHERE `reference` = '$account_reference' LIMIT
Hi
All of the MySQL functions you used, return FALSE on failure.
Niel
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
mysql_query($query) or die(mysql_error);
will give an error and stop the script if there is an issue, this also can
work for the mysql_select_db
bastien
From: Ron Piggott (PHP) [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: PHP DB php-db@lists.php.net
Subject: [PHP-DB] Verifying syntax
I have a script that creates a table copy using SELECT INTO, but I want it
to check if the new table already exists first. Does SQL support the EXISTS
keyword for SELECT INTO statements (I'm running PG7)?
If not, is there another way to do it in SQL? I'd rather not do it
programmatically.
Thanks
Tony Grimes wrote:
I have a script that creates a table copy using SELECT INTO, but I want it
to check if the new table already exists first. Does SQL support the EXISTS
keyword for SELECT INTO statements (I'm running PG7)?
If not, is there another way to do it in SQL? I'd rather not do it
See below...
Ron Piggott wrote:
Take a look at my if ( ) syntax line below. I am wondering if I have it
wrong in same way. What I am trying to achieve is if the alias the user
enters is already found in the database I want the words Alias already in
use to be shown on the screen; otherwise
PROTECTED]
Reply-To: Ron Piggott [EMAIL PROTECTED]
To: PHP DB php-db@lists.php.net
Subject: [PHP-DB] If syntax
Date: Sat, 1 Oct 2005 22:28:46 -0500
Take a look at my if ( ) syntax line below. I am wondering if I have it
wrong in same way. What I am trying to achieve is if the alias the user
enters
($result)==1))
{
echo Alias already in use;
} else {
echo Unique alias;
mysql_close();
}
Bastien
From: Ron Piggott [EMAIL PROTECTED]
Reply-To: Ron Piggott [EMAIL PROTECTED]
To: PHP DB php-db@lists.php.net
Subject: [PHP-DB] If syntax
Date: Sat, 1 Oct 2005 22:28:46 -0500
Take a look at my
alias LIKE '%' LIMIT 1;
at execution-time.
Regards,
Dave
-Original Message-
From: Jeffrey [mailto:[EMAIL PROTECTED]
Sent: Sun 10/2/2005 3:32 AM
To:
Cc: PHP DB
Subject: Re: [PHP-DB] If syntax
See below
:
Subject: RE: [PHP-DB] If syntax
Please PMJI, but I'm new to PHP but have a little experience with
databases, and I have a question:
Is there a particular reason that LIKE is used in the query? Let's say
you had the contrived alias value in the table, 'a
PROTECTED]
To: Bastien Koert [EMAIL PROTECTED]
CC: [EMAIL PROTECTED], php-db@lists.php.net
Subject: RE: [PHP-DB] If syntax
Date: Sun, 2 Oct 2005 22:25:16 +0530 (IST)
think this is wrong ... as it gives unique alias even if the query is not
executed ..
rajesh
On Sun, 2 Oct 2005, Bastien Koert wrote
Take a look at my if ( ) syntax line below. I am wondering if I have it
wrong in same way. What I am trying to achieve is if the alias the user
enters is already found in the database I want the words Alias already in
use to be shown on the screen; otherwise Unique alias to be shown on the
i think for unique alias u have keep
alias='$alias' ??
and also if statement will always be true as the mysql statement is
always correct and will be executed .
U have to check the result of query for whether there
r ne aliases or not ...
On Sat, 1 Oct 2005, Ron Piggott wrote:
Take a
Greetings,
I'm trying to set up a PHPWiki using Apache 2.0.49, PHP 4.3.7, PEAR 4.1.0,
and PHPWiki 1.3.10.
I get this error when trying to load index.php:
C:\Program Files\Apache
Group\Apache2\htdocs\lib\WikiDB\backend\PearDB.php:778: Fatal[256]:
wikidb_backend_mysql: fatal database error
DB
Hi!
You missed table definition:
... FROM my_table where ...
Wednesday, June 9, 2004, 12:57:02 PM, PHPDiscuss wrote:
PPNaml Greetings,
PPNaml I'm trying to set up a PHPWiki using Apache 2.0.49, PHP 4.3.7, PEAR 4.1.0,
PPNaml and PHPWiki 1.3.10.
PPNaml I get this error when trying to load
Hi list. I am a newbie and would like to ask if anyone could give me the
proper syntax for connecting with oracle DB. For example with MySQL it is:
mysql_connect..., mysql_query...
For MS SQL Server:
mssql_connect..., mssql_query...
What would be for oracle?
TIA
RS
This e-mail, including
It can be found here:
http://us3.php.net/manual/en/ref.oracle.php
MAO
-Original Message-
From: Rafi Sheikh [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 10, 2004 9:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Oracle syntax
Hi list. I am a newbie and would like to ask if anyone
Rafi Sheikh wrote:
Hi list. I am a newbie and would like to ask if anyone could give me the
proper syntax for connecting with oracle DB. For example with MySQL it is:
mysql_connect..., mysql_query...
For MS SQL Server:
mssql_connect..., mssql_query...
There are various examples in the PHP
- Original Message -
From: Addison Ellis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 28, 2003 10:46 PM
Subject: [PHP-DB] sql syntax error
hello,
i can not pinpoint this. your time and help is very much
appreciated. best, addison
Error:
id=, HTTP_POST_VARS
hi everyone,
I'm writing the code to make my mysql database searchable. I can search two
columns, but I seem to have problems when I try to search three.
In the SELECT statement, this WHERE statement works: WHERE column1 OR
column2 LIKE '%$search%' AND...
This WHERE statement doesn't work:
Try break up the query, like:
WHERE (column1 LIKE '%$search%' OR column2 LIKE '%$search%' OR column3 LIKE
'%$search%') AND ...
Tony S. Wu
Matthew K. Gold at [EMAIL PROTECTED] wrote:
hi everyone,
I'm writing the code to make my mysql database searchable. I can search two
columns, but I
Great--it works now. Thanks very much, Tony. I appreciate your help.
best,
Matt
- Original Message -
From: Tony [EMAIL PROTECTED]
To: Matthew K. Gold [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, July 22, 2002 1:01 AM
Subject: Re: [PHP-DB] search syntax
Try break up the query
I was using phpMyAdmin to do an export from one machine to another and on
import I got an error:
Error
SQL-query :
CREATE TABLE hospital (
id smallint(5) unsigned NOT NULL auto_increment,
heath_system_id smallint(5) unsigned default NULL,
name_long tinytext NOT NULL,
name_short
desc is a key word. :-\
-Original Message-
From: Michael Zornek [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 10:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Mysql syntax error - phpMyAdmin ??
I was using phpMyAdmin to do an export from one machine to another and on
import
Try [desc]
-Original Message-
From: Ryan Jameson (USA)
Sent: Wednesday, July 10, 2002 10:51 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Mysql syntax error - phpMyAdmin ??
desc is a key word. :-\
-Original Message-
From: Michael Zornek [mailto:[EMAIL PROTECTED]]
Sent
I can't say for sure, but perhaps desc is a reserved word, short for
describe. What happens if you say something like description?
Chip
On Wed, 10 Jul 2002, Michael Zornek wrote:
I was using phpMyAdmin to do an export from one machine to another and on
import I got an error:
Error
DESC is a reserved word in SQL, standing for Descending Order. That is why you can't
use it as a table column name.
HTH
Martin
Michael Zornek [EMAIL PROTECTED] 07/10/02 12:49PM
I was using phpMyAdmin to do an export from one machine to another and on
import I got an error:
Error
Sorry, [desc] won't work either. :-(
-Original Message-
From: Chip Atkinson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 10:54 AM
To: Michael Zornek
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Mysql syntax error - phpMyAdmin ??
I can't say for sure, but perhaps desc
On Thursday 11 July 2002 01:00, Ryan Jameson (USA) wrote:
Sorry, [desc] won't work either. :-(
Try `desc`.
But it's best not to use 'desc' at all, it will save you confusion in the long
run.
--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
*
Twas 7/10/02 12:55 PM, when Martin Clifford [EMAIL PROTECTED] said:
DESC is a reserved word in SQL, standing for Descending Order. That is why
you can't use it as a table column name.
Ok, that makes sence - thanks!
Although I find it a bit curious that building the DB in phpMyAdmin let me
:
http://www.mysql.com/doc/L/e/Legal_names.html
Gurhan
- Original Message -
From: Michael Zornek [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 1:30 PM
Subject: Re: [PHP-DB] Mysql syntax error - phpMyAdmin ??
Twas 7/10/02 12:55 PM, when Martin Clifford [EMAIL
I'm using PHP and MySQL Web Development published by SAM's. I believe the
story_submit.php file for the Content Mangement script in Chapter 26 has a
syntax problem. I'm getting errors. I'm very new to MySQL PHP and would
appreciate some help. The form has a field for uploading an optional .html
]
Date: Tuesday, July 17, 2001 2:39 AM
Subject: [PHP-DB] Need syntax for conditional in recordset loop
How would I code IF .odbc_result($data2,$i) = 'SOX' THEN make it a link?
By link I mean that I want the word SOX highlited in blue and underlined
and referencing a webpage that explains SOX
How would I code IF .odbc_result($data2,$i) = 'SOX' THEN make it a link? By link I
mean that I want the word SOX highlited in blue and underlined and referencing a
webpage that explains SOX verbosefully. Don't know PHP IF THEN syntax too well.
/* fill table with data */
do
{
echo tr;
Publish first part of the php code so that we can see what's wrong in line
13 (or 12 sometimes).
Rudolf Visagie
[EMAIL PROTECTED]
-Original Message-
From: Marc S. Bragg [mailto:[EMAIL PROTECTED]]
Sent: 15 March 2001 10:39
To: [EMAIL PROTECTED]
Subject: syntax trouble
What does this
57 matches
Mail list logo