Kranthi.
http://goo.gl/e6t3
On 1 March 2012 21:47, Carl Michael Skog cms...@gmail.com wrote:
-- Vidarebefordrat meddelande --
Från: Carl Michael Skog cms...@gmail.com
Datum: 1 mars 2012 17:12
Ämne: Re: [PHP-DB] Select from multiple tables
Till: Kranthi Krishna kranthi
On Wed, Feb 29, 2012 at 3:01 PM, Kranthi Krishna kranthi...@gmail.com wrote:
Hi all,
Say I have an object like
array
schoolName = string
board = array
string
string
I generally create two MySql tables
schools: id PRIMARY KEY, SchoolName
boards: id FOREGIN KEY
Hi,
Thanks for the input. I have seen some tutorials on joins, they all
suggest that MySql returns multiple rows
For example
--
School | Board 1
--
School | Board 1
-
Now if I have another one-to-many relation
Hi,
The examples I saw were regarding cartesian join not inner join. I
will read about inner joins. Also, the example i mentioned seems to be
a mistake. Both school and type will not be similar at the same time
Kranthi.
http://goo.gl/e6t3
On 1 March 2012 09:26, Kranthi Krishna
Dear Kranthi
You have to be clear what you decide especially when you are getting
multiple rows. To get just a single row you can use LIMIT clause.
But it would return only one row. Now you have to decide which row.
So i think you decide on what you require and see how can you uniquely
Try DISTINCT
On Feb 29, 2012, at 10:28 PM, Amit Tandon wrote:
Dear Kranthi
You have to be clear what you decide especially when you are getting
multiple rows. To get just a single row you can use LIMIT clause.
But it would return only one row. Now you have to decide which row.
So i think
Hi all,
SELECT DISTINCT s.Title, b.Board_id, t.type FROM school s,
board_entries b, schooltypeentries t WHERE s.School_id = 1698 AND
b.School_id = 1698 AND t.schoolid = 1698
this SQL query gives me
Kendriya Vidyalaya 15 Kick Boxing
Kendriya Vidyalaya 15 Karate
Kendriya
This is just a stab in the dark and may be in the wrong order. If it
does not work I apologize.
SELECT s.Title, (SELECT DISTINCT b.Board_id), (SELECT DISTINCT
t.type), (SELECT s.School_id AND
b.School_id AND t.schoolid AS id ) FROM school s,
board_entries b, schooltypeentries t WHERE id =
-Original Message-
From: tamouse mailing lists [mailto:tamouse.li...@gmail.com]
Sent: 20 October 2011 21:37
On Tue, Oct 18, 2011 at 5:36 AM, Ford, Mike m.f...@leedsmet.ac.uk
wrote:
-Original Message-
From: Ron Piggott [mailto:ron.pigg...@actsministries.org]
Sent: 17
On Fri, Oct 21, 2011 at 2:09 AM, Ford, Mike m.f...@leedsmet.ac.uk wrote:
-Original Message-
From: tamouse mailing lists [mailto:tamouse.li...@gmail.com]
Sent: 20 October 2011 21:37
On Tue, Oct 18, 2011 at 5:36 AM, Ford, Mike m.f...@leedsmet.ac.uk
wrote:
-Original Message-
On Tue, Oct 18, 2011 at 5:36 AM, Ford, Mike m.f...@leedsmet.ac.uk wrote:
-Original Message-
From: Ron Piggott [mailto:ron.pigg...@actsministries.org]
Sent: 17 October 2011 18:38
I need help creating a mySQL query that will select the correct
introduction message for a website I am
On Thu, Oct 20, 2011 at 3:36 PM, tamouse mailing lists
tamouse.li...@gmail.com wrote:
On Tue, Oct 18, 2011 at 5:36 AM, Ford, Mike m.f...@leedsmet.ac.uk wrote:
-Original Message-
From: Ron Piggott [mailto:ron.pigg...@actsministries.org]
Sent: 17 October 2011 18:38
I need help creating
-Original Message-
From: Ron Piggott [mailto:ron.pigg...@actsministries.org]
Sent: 17 October 2011 18:38
I need help creating a mySQL query that will select the correct
introduction message for a website I am making. The way I have
designed the table I can’t wrap my mind around
Ron - Mike here is correct. I gave you a start, but it had a problem with
it. Hope I didn't have you running around too much.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Dear Ron
If only day is required u could add another day condition in the where
clause e.g. month(current_date) between and day(current_date) between. i
think u require something more than this. So could u pls explain your
requirement in a little more detail say what would be the output of the
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
Not terribly elegant, but this should work:
SELECT `trivia_answer_1` AS `trivia_answer` FROM `Bible_trivia` WHERE `answer`=1
UNION
SELECT `trivia_answer_2` AS `trivia_answer` FROM `Bible_trivia` WHERE `answer`=2
UNION
SELECT `trivia_answer_3` AS `trivia_answer` FROM `Bible_trivia` WHERE
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
Ron
Have u thought of CASE (in
SELECT)http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html.
Remebber their is some syntactical difference in CASE for SELECT and
CASE in procedures
regds
amit
The difference between fiction and reality? Fiction has to make sense.
On
Subject: Re: [PHP-DB] SELECT online store discount %
Ron
Have u thought of CASE (in SELECT). Remebber their is some syntactical
difference in CASE for SELECT and CASE in procedures
regds
amit
The difference between fiction and reality? Fiction has to make sense.
On Sun, Aug 21
Have a look at this:
http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_char-length
On Thu, Mar 10, 2011 at 9:49 AM, Ron Piggott ron.pigg...@actsministries.org
wrote:
Is there a command in mySQL that would allow me to SELECT the rows where
the `fax` column is more than 11
On Wed, Mar 9, 2011 at 17:49, Ron Piggott
ron.pigg...@actsministries.org wrote:
Is there a command in mySQL that would allow me to SELECT the rows where the
`fax` column is more than 11 characters long?
There is.
SELECT * FROM tblName WHERE CHAR_LENGTH(fax) = 11;
(Presuming you
On 11 September 2010 07:47, Ron Piggott ron.pigg...@actsministries.org wrote:
I wrote the query below to determine the 10 most popular words used:
SELECT COUNT( `bible_concordance_usage`.`reference` ) AS word_usage,
`bible_concordance_words`.`reference` , `bible_concordance_words`.`word`
Hello,
This may help.
http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html
Best,
Karl
On Sep 11, 2010, at 1:47 AM, Ron Piggott wrote:
I wrote the query below to determine the 10 most popular words used:
SELECT COUNT( `bible_concordance_usage`.`reference` ) AS word_usage,
Then each record needs to have a user filed where their is stored. Then your
access query just adds an additional filter to check this value
Select * from data_table where user = $user
Bastien
Sent from my iPod
On Sep 5, 2010, at 7:21, nagendra prasad nagendra802...@gmail.com wrote:
Hi
PS: Want to check the username from a table and the password from another
table.
Is it possible ??
I would suggest that you keep authorization separate from data access
Bastien
Sent from my iPod
On Sep 5, 2010, at 9:19, nagendra prasad nagendra802...@gmail.com wrote:
PS: Want to check the username from a table and the password from another
table.
Is it possible ??
--
PHP Database
On 13/08/10 13:26, Ron Piggott wrote:
If the variable $segment has an ' in it the $query won't work because of
having 3 ' 's.
Should I be using:
$segment = mysql_real_escape_string($segment);
before querying the database?
Use it in your query. Don't use it anywhere else. Your code may use
Eleonora De Marinis eleonora.demari...@garr.it, haber iletisinde sunlari
yazdi:49fe92d0.2060...@garr.it...
$sql = SELECT * FROM table WHERE ID ='$_GET[id]' AND title LIKE
'%$_GET[word]%';
Original Message
Subject: [PHP-DB] SELECT LIKE with %' and without %'
From:
$sql = SELECT * FROM table WHERE ID ='$_GET[id]' AND title LIKE
'%$_GET[word]%';
Original Message
Subject: [PHP-DB] SELECT LIKE with %' and without %'
From: Emiliano Boragina emiliano.borag...@gmail.com
To: php-db@lists.php.net
Date: 05/03/2009 01:43 AM
Hello.
I am using
On May 2, 2009, at 6:43 PM, Emiliano Boragina wrote:
Hello.
I am using this:
$sql = SELECT * FROM table WHERE ID LIKE '%$_GET[id]%' AND title LIKE
'%$_GET[word]%';
But I want exactlu ID, not one part of many possibles Ids in the DB.
How can I do that?
PLEASE tell me your cleaning that
Emiliano Boragina wrote:
Hello.
I am using this:
$sql = SELECT * FROM table WHERE ID LIKE '%$_GET[id]%' AND title LIKE
'%$_GET[word]%';
This doesnt work?
$sql = SELECT * FROM table WHERE ID='some_id' AND title='some_title';
--
Extra details:
OSS:Gentoo Linux
profile:x86
Hardware:msi
SELECT *
FROM gig
LEFT JOIN genre ON gig.genreId = genre.genreId
LEFT JOIN venue ON gig.venueID = venue.vid
WHERE gig.gigid = $gigdetail
I'd replace the dash with [table].[columnames]. Also, you're using four
different naming conventions in your columns - gigid, genreId, venueID
and vid. If I
($result))
{/
/$sub= $row[venue].[vname];/
/}/
Regards
- Original Message
From: Evert Lammerts [EMAIL PROTECTED]
To: Nasreen Laghari [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Wednesday, April 23, 2008 11:48:39 AM
Subject: Re: [PHP-DB] Select query with Forein key Relation
ministry_directory_listing_categories.ministry_directory_category_reference =
10 AND
ministry_directory_listing_categories.ministry_directory_category_reference
= 11
Can a record really have a reference for two different id's like this?
ie can it be both '10' and '11' at the same time?
Two different rows Chris.
reference ministry_directory_entry ministry_directory_category_reference
13 1 10
14 1 11
What I am trying to do is allow the user to make a more specific search.
Ron
On Mon, 2008-03-10 at 10:37 +1100, Chris wrote:
Ron Piggott wrote:
Two different rows Chris.
That's the problem then.
Your query is saying get records with category_reference of 10 and it
has to have category_reference of 11 as well.
No such rows exist.
Maybe that should be an 'or' or 'in' (same thing).
...
I think what you mean to do is use IN(). And I would suggest table aliases.
So it could look like this:
SELECT * FROM ministry_directory md INNER JOIN
ministry_directory_listing_categories mdlc ON md.entry =
mdlc.ministry_directory_entry
WHERE md.listing_type = 2
AND
Thanks
On Mon, 2008-03-10 at 12:56 +1300, Bruce Cowin wrote:
I think what you mean to do is use IN(). And I would suggest table aliases.
So it could look like this:
SELECT * FROM ministry_directory md INNER JOIN
ministry_directory_listing_categories mdlc ON md.entry =
$query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' OR WHERE
gig_fdate='$sdate');
This one.
I'd suggest you get a book to help you with the basics, something like
this should do (first hit in amazon, haven't actually read this
particular book):
In MySQL, both OR and || are valid logical or operators. You can only
have one Where clause, thus your last example is correct.
--GREG
On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari [EMAIL PROTECTED]
wrote:
Hi All,
Thank you for increasing my knowledge about PHP/MYSQL.
I am creating a
Greg Bowser wrote:
In MySQL, both OR and || are valid logical or operators. You can only
have one Where clause, thus your last example is correct.
Though in postgresql and db2 (and some other dbs) || means
concatenate so stick with using the word OR in this situation
otherwise you'll run
On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari
[EMAIL PROTECTED] wrote:
I am creating a SEARCH, by only using one table. The search form is same as
Inserting item (search has form of all fields in table ), difference is
SEARCH page doesnt have validation . Therefore user can enter
On 27 Feb 2008, at 23:44, Nasreen Laghari wrote:
Thank you for increasing my knowledge about PHP/MYSQL.
The question you ask below is basic SQL syntax. Please read the MySQL
manual before asking here - answers at this level are all in there.
http://mysql.com/doc
Oh, and once you have it
$query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' or
gig_fdate='$sdate');
You can not use more then one WHERE in your sql statement... And SQL accepts
OR and AND..
--
Stephen Johnson c | eh
The Lone Coder
http://www.thelonecoder.com
continuing the struggle against bad code
$query = mysql_query(SELECT * FROM gig WHERE gigName='$gig_name' OR
gig_fdate='$sdate');
You only use the WHERE clause once then use parenthesis, AND and OR to create
the logical conditions.
If you have access to the mysql server, maybe through phpMyAdmin or
something, I'd highly recommend
Hi
First off, please create your own thread, do not reply to someone else's
and change the subject.
I'm having kind of trouble to get done this: Select data from a table,
except those data already in a second table. Actually, if there is a rowid
in table2, I wont get it from table1, rowid is
Original Message
Subject: [PHP-DB] Select...
From: Miguel Guirao [EMAIL PROTECTED]
To: php-db@lists.php.net
Date: 15.1.2008 4:44
Hello List,
I'm having kind of trouble to get done this: Select data from a table,
except those data already in a second table. Actually, if there
Please fix your reply-to address.
It
is an SQL query (probably MySQL, but perhaps SQLite or possibly even PGSQL or
mSQL):
The line after $query should tell you what uses it ;)
$query=SELECT TABLE $tablename;;
if (mysql_query($query, $link)) {
echo($indent.The table,
Chris wrote (in news:[EMAIL PROTECTED]):
It is an SQL query (probably MySQL, but perhaps SQLite or possibly even
PGSQL or mSQL):
The line after $query should tell you what uses it ;)
Sorry, I meant the book may have been about any of those; I was skimming through
a bunch of SQL books at that
Businesses
--
id
businessName
isChristianBookstore
isGift
isHomeDecor
isSkinCareAndCosmetics
isThriftStore
CREATE TABLE `Businesses` (
`id` BIGINT NOT NULL AUTO_INCREMENT ,
`businessName` VARCHAR( 64 ) NOT NULL ,
`isChristianBookstore` TINYINT( 1 ) NOT NULL ,
`isGift` TINYINT( 1 ) NOT
cmiiw.. since i don't the visual what u said bellow
- Original Message -
From: Ron Piggott [EMAIL PROTECTED]
To: PHP DB php-db@lists.php.net
Sent: Tuesday, April 24, 2007 11:31 AM
Subject: [PHP-DB] SELECT string
I am looking for help to write a SELECT syntax to help me process a
i tend to take the approach of
$next_wed = date(Y-m-d, strtotime(next wednesday));
Bastien
From: Niel Archer [EMAIL PROTECTED]
Reply-To: php-db@lists.php.net
To: php-db@lists.php.net
Subject: Re: [PHP-DB] SELECT date query
Date: Sat, 07 Oct 2006 05:49:36 +0100
Hi Ron
I've made
Hi!
You can make this easier with date('w').
$correction = array(3, 2, 1, 7, 6, 5, 4);
list($year, $month, $day, $dayOfWeek) = explode('|', date('Y|m|d|w'));
echo date (Y.m.d, mktime
(0,0,0,$month,$day+$correction[$dayOfWeek],$year));
Regards,
Felhő
Niel Archer wrote:
Hi Ron
I've
Hi
You can make this easier with date('w').
Doh, that'll teach me to code at 5 am. I knew there was a better way,
but couldn't think of it, the sound of my bed calling was too
distracting.
Niel
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit:
Hi Ron
I've made the assumption that if today is Wednesday, you still want next
Wednesday.
Try this:
$offset = array(3,2,1,7,6,5,4);
$date = explode(-, date(Y-n-j));
$ToDay = DayOfWeek($date[0], $date[1], $date[2]);
$NextWed = date(Y-n-j, time() + ($offset[$ToDay] * 24 * 60 * 60));
// Returns a
is the only way to go.
-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 07, 2006 8:50 AM
To: Blanton, Bob
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Select distinct field won't return distinct value
Blanton, Bob wrote:
I'm just learning MySQL so don't know all
: RE: [PHP-DB] Select distinct field won't return distinct value
Date: Tue, 6 Jun 2006 23:44:22 -0400
I'm just learning MySQL so don't know all the syntax. There is a LIST
function in Sybase Adaptive Server Anywhere which would do that. Is
there an equivalent function in MySQL?
Query:
SELECT
Perhaps you should fix your data model...
but with your current set up, try:
select cus_name, cus_id from customers group by cus_name order by
cus_name asc
-Brad
Mohamed Yusuf wrote:
I want select distinct field and return value of that field, but I have
problem which is: select distinct
Correct me if I'm wrong, but it sounds like you have something like this:
123 Joe
124 Joe
125 Sue
126 John
127 Joe
128 Frank
129 Sue
And you want to output something like:
Joe 123, 124, 127
Sue 125, 129
John 126
Frank 128
But what you're getting is:
Joe 123
Joe 124
..etc
You have
I thank you all. problem solved using two queries as TQ mentioned.
On 6/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
Correct me if I'm wrong, but it sounds like you have something like this:
123 Joe
124 Joe
125 Sue
126 John
127 Joe
128 Frank
129 Sue
And you want to output
PM
To: php-db@lists.php.net
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Select distinct field won't return distinct value
Correct me if I'm wrong, but it sounds like you have something like
this:
123 Joe
124 Joe
125 Sue
126 John
127 Joe
128 Frank
129 Sue
And you want to output something
Blanton, Bob wrote:
I'm just learning MySQL so don't know all the syntax. There is a LIST
function in Sybase Adaptive Server Anywhere which would do that. Is
there an equivalent function in MySQL?
Query:
SELECT distinct niin, list(serial_number) FROM
fmds.maintenance_equipment
group by niin
-db@lists.php.net
Subject: Re: [PHP-DB] Select distinct field won't return distinct value
Blanton, Bob wrote:
I'm just learning MySQL so don't know all the syntax. There is a
LIST
function in Sybase Adaptive Server Anywhere which would do that. Is
there an equivalent function in MySQL?
Query
Possibility?
WHERE (`date_created` = '$date_90_minutes_ago' AND
`time_created` = '$time_90_minutes_ago') or
(`date_created` '$date_90_minutes_ago' AND
`time_created` '01:30:00')
Ade
Ron Piggott (PHP) wrote:
Yesterday I asked how to get the date time 90 minutes ago and I
received
Convert both to unix timestamps...be much easier to wrok with both date and
time then
bastien
From: Ron Piggott (PHP) [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: PHP DB php-db@lists.php.net
Subject: [PHP-DB] SELECT
Date: Fri, 20 Jan 2006 06:00:33 -0500
Yesterday I asked how to get the
On Sun, 2005-12-04 at 13:38 -0500, Ron Piggott (PHP) wrote:
I have two questions.
I would like to display the contents of my table with the first row
being grey in background and the next row being white and the third row
being grey, fourth being white, etc. I am not sure how to do this.
There's a couple of ways to do this. For the row color you would set that
as you looped through the returned rows. Using the pear db class:
$count = 0;
echo table\n;
while($db-fetchInto($data)) {
$count++;
if($count % 2 == 0) {
$bgColor =
Hey, this is my first question. So if you could just reply to say it
reached the php-db list, that would be terrific. Of course, answering the
questions would be awesome as well.
I meant
'Analyze table'
and
'the composite key field2 field3 would be unique'
- Original Message -
I think no one answered it because it doesn't make a whole lot of sense.
Breaking a condition out into a second SQL statement would force the DB to
rescan the table, so it should take longer rather than shorter. There's
nothing suggesting that it's doing an internal self-join or other
[EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Thursday, August 18, 2005 9:49 AM
Subject: Re: [PHP-DB] SELECT Performance and INDEXing
I think no one answered it because it doesn't make a whole lot of sense.
Breaking a condition out into a second SQL statement would force the DB to
rescan
Subject: Re: [PHP-DB] SELECT Performance and INDEXing
I think no one answered it because it doesn't make a whole lot of sense.
Breaking a condition out into a second SQL statement would force the DB
to rescan the table, so it should take longer rather than shorter.
There's nothing suggesting
type of composite index on (field2, field3) would be
better. Then again, any combination with field1 would also be unique.
- Original Message -
From: Micah Stevens [EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Thursday, August 18, 2005 12:33 PM
Subject: Re: [PHP-DB] SELECT
I meant
'Analyze table'
and
'the composite key field2 field3 would be unique'
- Original Message -
From: Dwight Altman [EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Wednesday, August 10, 2005 4:23 PM
Subject: [PHP-DB] SELECT Performance and INDEXing
I have a MyISAM table holding
I have no problem creating a table, using a query from my dbase table news:
SELECT * FROM table where column = VALUE.
However, now that most of our articles have more than one column type (i.e.
instead of just technology, the column can now contain technology, politics,
local.
You need
On Tuesday 21 June 2005 10:35 pm, Dan Fulbright wrote:
I have no problem creating a table, using a query from my dbase table
news:
SELECT * FROM table where column = VALUE.
However, now that most of our articles have more than one column type
(i.e. instead of just technology, the
use full text searches
http://dev.mysql.com/doc/mysql/en/fulltext-search.html
bastien
From: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] select * from table where column 'CONTAINS' more than one
value (how?)
Date: Tue, 21 Jun 2005 20:49:12 EDT
Hello all,
I have no problem
You can use LIKE and wildcards, which is faster than fulltext searches, which
will provide you a lot of information you don't need.
Do this:
SELECT * FROM table where column LIKE %politics% OR column LIKE %local%
to find if the field contains politics or local..
-Micah
On Tuesday 21 June
Hi,
Instead of doing a SELECT *, specify the fields that you require. Allthough
you may think the rows are exactly the same, one might be empty () and one
null which is not the same.
You are more likely to get the result that you need if you specify the
fields:
SELECT DISTINCT somedata, rev,
distinc needs a field
select distinct(name) from table
bastien
From: MIGUEL ANTONIO GUIRAO AGUILAR [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Select
Date: Mon, 16 May 2005 19:26:20 -0700
Hi!!
I have this query in PHP:
$items2 = mysql_query(SELECT DISTINCT * FROM rev ORDER BY rev,
PM
Subject: Re: [PHP-DB] select text from a text file
On Wed, 5 Jan 2005 11:58:59 -, Ed [EMAIL PROTECTED] wrote:
Happy new year folks!
The titlemight make this seem like an easy to answer question
However here's the complicated bit (well for me anyway).
In my text file
Message -
From: Andrew Kreps [EMAIL PROTECTED]
To: Ed [EMAIL PROTECTED]; php-db@lists.php.net
Sent: Thursday, January 06, 2005 6:55 PM
Subject: Re: [PHP-DB] select text from a text file
On Wed, 5 Jan 2005 11:58:59 -, Ed [EMAIL PROTECTED] wrote:
Happy new year folks!
The titlemight make
Message -
From: Jochem Maas [EMAIL PROTECTED]
To: Ed [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Friday, January 07, 2005 11:37 AM
Subject: Re: [PHP-DB] select text from a text file
Ed wrote:
Hi,
Thanks for answering the question.
I'm going to make it write to a database rather
grabbed message after you have selected it for output.
have fun!
Ed
- Original Message -
From: Jochem Maas [EMAIL PROTECTED]
To: Ed [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Friday, January 07, 2005 11:37 AM
Subject: Re: [PHP-DB] select text from a text file
Ed wrote:
Hi,
Thanks
PROTECTED]
CC: php-db@lists.php.net
Subject: Re: [PHP-DB] select text from a text file
Date: Fri, 7 Jan 2005 08:58:18 -
Hi,
Thanks for answering the question.
I'm going to make it write to a database rather than text file after
searching google and coming accross common problems with text files.
I've
the
answer.
Ed
- Original Message -
From: Bastien Koert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Friday, January 07, 2005 2:06 PM
Subject: Re: [PHP-DB] select text from a text file
simple, add a 'read flag' column to the table, when
On Wed, 5 Jan 2005 11:58:59 -, Ed [EMAIL PROTECTED] wrote:
Happy new year folks!
The titlemight make this seem like an easy to answer question
However here's the complicated bit (well for me anyway).
In my text file that is written to by the users in a chatroom it looks like
this:
INSERT INTO `dbname`.`newtablename`
SELECT *
FROM `dname`.`oldtablename` ;
bastien
From: blackwater dev [EMAIL PROTECTED]
Reply-To: blackwater dev [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] select particular columns in query
Date: Wed, 8 Dec 2004 10:46:44 -0500
Hello,
I want to
The manual is your friend.
You cannot execute the SQL statement you provided because mysql specifically
disallows it:
http://dev.mysql.com/doc/mysql/en/INSERT_SELECT.html
Same reference, your presumption about auto-increment columns is also wrong.
Doug
blackwater dev wrote:
Hello,
I want to
I'm trying to pull all the records from the table class where classID is
not equal to the value of classID in the table assignment.
Currently, I have 'select class.classID, class.classDesc from class,
assignment where assignment.classID = class.classID and
assignment.assignmentID=$assidn'.
Thanks!
It works
Cole
On Thu, 2004-08-26 at 16:45, [EMAIL PROTECTED] wrote:
I'm trying to pull all the records from the table class where classID is
not equal to the value of classID in the table assignment.
Currently, I have 'select class.classID, class.classDesc from class,
Chris Payne wrote:
I'm using Booleans in my searches (New to it) but it works perfectly
on my
local 3.23 version of MySQL, but on the main server which uses version 4 of
MySQL I get an error so there's an error in my Syntax. Here's what I
currently use:
[snip]
From: T. H. Grejc [EMAIL PROTECTED]
I would like to display my news like this:
*10.04.2004.*
- news 1
- news 2
- news 3
*14.04.2004.*
- news 4
*15.04.2004.*
- news 5
...
I'm thinking of some while loop but I'm not sure that it will work nor I
know how to create that query.
Hi!
You can use order by date and such method:
code
$result = mysql_query(blablabla);
$date = foo;
while($news = mysql_fetch_array($result)){
if ($date==$news[date]){
echo new date;
}
echo $news[text];
$date = $news[date];
}
Monday, May 17, 2004, 3:50:04 PM, T. wrote:
ORDER BY date, text ?
Hi!
You can use order by date and such method:
code
$result = mysql_query(blablabla);
$date = foo;
while($news = mysql_fetch_array($result)){
if ($date==$news[date]){
echo new date;
}
echo $news[text];
$date = $news[date];
}
Monday, May
Irin said:
$sql = mysql_query(SELECT * FROM class where timetable_day='Monday');
$row = mysql_fetch_array($sql);
$result = $db-query($sql);
$numofrows = mysql_num_rows($sql);
From the PHP manual:
array mysql_fetch_array ( resource result [, int result_type])
You can't send the function
Irin said:
$sql = mysql_query(SELECT * FROM class where timetable_day='Monday');
Oops, I see that he DID do a mysql_query and save the result resource in
$sql. Sorry, guys! I haven't had my coffee yet this morning!
Katie Dewees
Web Developer
E-mail: [EMAIL PROTECTED]
--
PHP Database Mailing
1 - 100 of 221 matches
Mail list logo