, 2002 3:37 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Query with numbers like 1, 3, 5..
Hi again Rick! : )
It is because I am trying to list all products that I have in a database
into a menu page. And I would like to have two products beside eachothers.
So... is it possible to get
Subject: RE: [PHP-DB] Query with numbers like 1, 3, 5..
Yes, but the question is why?
-Original Message-
From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 1:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Query with numbers like 1, 3, 5
I like Mike's WHILE-loop better than my solution.
thanks, Mike
-Original Message-
From: Mike Gohlke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 3:56 PM
To: Raymond Lilleodegard; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Query with numbers like 1, 3, 5
ay to do it?
Reagrds Raymond
- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'Raymond Lilleodegard' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, February 07, 2002 8:55 PM
Subject: RE: [PHP-DB] Query with numbers like 1, 3, 5..
Yes, but the questio
Ok what is wrong with this sql statement?
$sql = UPDATE $table_name SET
c_name=\$c_name\,s_addy=\$s_addy\,city=\$city\,state=\state\zip=\zi
p\,phone=\$phone\;
The error I recieve is as follows
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
/path/to/wwwdemo_change.php3 on line
Try putting single quotes around your variables in your update statement
instead of the escaped double quotes, they are easier to read.
Also, were you wanting to update all entries in that table to the same,
c_name, s_addy, city, state, zip and phone? If not, you will need to
add 'where
Ok jas
Ok what is wrong with this sql statement?
$sql = UPDATE $table_name SET
c_name=\$c_name\,s_addy=\$s_addy\,city=\$city\,state=\state\zip=\zi
p\,phone=\$phone\;
insufficient checking:
comma missing between state and zip
incorrectly escaped before phone
...
I have looked on MySQL.com
Did you type this out or cut/paste? There was a comma missing between
state\zip . Should work when you add the comma.
Add a WHERE condition for the update, otherwise every row will be set to
these values.
Common practice is to use single quotes around the char variables, saves a
lot of
Hi Balazs,
The situation: I have 2 tables in an adverising site. In one table, i have
the cities used by advertisers, and in the other there are the ads.This ad
table has a field which refers to the id of the city in that table.
The problem: what mysql method should i use if i want to
JOIN adverts a using(city_id)
ORDER BY city;
-Original Message-
From: Ivan Balazs [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 04, 2002 6:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] query from two tables
Hi!
The situation: I have 2 tables in an adverising site. In one table, i
Hi,
I have problem with these mysql's query:
select * from holder, management where holder.id=management.id or
(holder.name=management.name and holder.surname=management.surname) order
by holder.no
It take a long time (more than 1 minute) with thousand record. I have
On Tuesday 22 January 2002 13:18, Sommai Fongnamthip wrote:
Hi,
I have problem with these mysql's query:
select * from holder, management where holder.id=management.id or
(holder.name=management.name and holder.surname=management.surname) order
by holder.no
It take a
Hello Friends,
I've some performance problem, when I do sum() functions on my tables it
took 5-7 minutes to return the results.. here is my story:
I've table with 2461566 rows here is my table structure:
mysql describe imp_log;
Addressed to: Nomor Satu Bajingan [EMAIL PROTECTED]
[EMAIL PROTECTED]
** Reply to note from Nomor Satu Bajingan [EMAIL PROTECTED] Thu, 10
Jan 2002 13:51:06 +
Hello Friends,
I've some performance problem, when I do sum() functions on my tables it
took 5-7 minutes to return
I have two tables, the first one I query like :
$query = SELECT * FROM xp_topics WHERE artist_count='artist' AND topictext LIKE
'B%' ORDER BY artist_count DESC limit 0,5; $req = mysql_query($query);
$res = mysql_num_rows($req); if ($res == 0) { echo /p
pbSorry
Hi,
I hate to simply refer to other sources in a response, but cross-tabulations are a
large and rich subject which are
too large for the time I have to write this email. I would suggest reading this
article:
http://www.devshed.com/Server_Side/MySQL/MySQLWiz
which is a pretty good source
Hi people,
I have a small problem with a select cause that I need to use.
I basically need the following.
Select * from table where page =3D=3D page_name
The fields in the db are
code,description,unit,price,category,minor_category
Then the display needs to be something along the lines of
select * from tbl where email like %$email%; This will find the string stored in the
variable
'$email' in the column 'email'
Adjust having the '%' at the end, the beginning or both (as above) as they will find
the string
'$email' at end or at the beginning of the string stored in the column
No this will not do what the original poster requested
it will be something like the following
select * from table where email regexp
^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$;
Regards
Jon
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob
Glad someone knows more than I do, or that chap would be right up a certain creek
without a paddle..
Cheers
Russ
On Wed, 28 Nov 2001 09:44:26 - Jon Farmer [EMAIL PROTECTED] wrote:
No this will not do what the original poster requested
it will be something like the following
select
Hi there everyone:
I have a generic query containing variables, substituted for values dependant upon
specific
circumstances:
//query the DB on the basis of searches employing text input fields (LIKE)
if($sql_clause == 'LIKE') {
$sql = SELECT * FROM $table WHERE $field $sql_clause
://www.icygen.com
BALANCED SOLUTIONS
- Original Message -
From: Russ Michell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 28, 2001 5:36 PM
Subject: [PHP-DB] query + loop problem
Hi there everyone:
I have a generic query containing variables, substituted for values
Try using mysql_query to describe the table in question (describe $table), and use the
output
as a list of field names (and types). I wrote a generic script to do this for an
app... can
provide if needed (although it sure looks a little hacked right now, hmmm)
-db
Russ Michell wrote:
Hi
PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 28, 2001 5:36 PM
Subject: [PHP-DB] query + loop problem
Hi there everyone:
I have a generic query containing variables, substituted for values dependant upon
specific
circumstances:
file://query the DB on the basis
what's the LIKE query to see if an email address is valid?
For example, in PHP it's something like
if
(eregi(^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$,$
email,$check)) {
echo valid;
}
i want to sort through rows in a db and look for invalid email
This doesn't work either.
SELECT count(freerooms.room), WEEK(MAX(booking.date),1),
WEEK(MIN(booking.date),1) as total FROM freerooms LEFT JOIN booking
USING(room);
All good so far
now if I run this
SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1)
FROM freero
oms f,
-
From: Matt Williams [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Monday, November 19, 2001 10:26
Subject: RE: [PHP-DB] Query help
This doesn't work either.
SELECT count(freerooms.room), WEEK(MAX(booking.date),1),
WEEK(MIN(booking.date
Not really this list but I'm after a quick bit of help.
If I run this query
select count(room) from freerooms;
-83
and this
SELECT WEEK(MAX(date),1), WEEK(MIN(date),1)as totalweeks FROM booking;
-4840
All good so far
now if I run this
SELECT count(f.room),WEEK(MAX(b.date),1),
it in
USING
Other problems?
Write..
Regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS
- Original Message -
From: Matt Williams [EMAIL PROTECTED]
To: Php-Db@Lists. Php. [EMAIL PROTECTED]
Sent: Friday, November 16, 2001 5:20 PM
Subject: [PHP-DB] Query help
5:32 PM
Subject: Re: [PHP-DB] Query help
SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1) FROM freero
oms f, booking b;
will be
SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1) FROM freero
oms f LEFT JOIN booking USING(room) b;
room is the field which connects
Hi there:
Further to a previous submission (which can be ignored), I'd like the following query
to 'search' a
table field of different team names (stored as a single string), but it does't seem to
work!
SELECT * FROM $table_users WHERE usrName='$username' AND
usrPswd=password('$password')
When you printed-out the string variable containing the SELECT statement,
what did it look like?
-Original Message-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 9:01 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Query construction
Hi there:
Further
?
-Original Message-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 9:01 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Query construction
Hi there:
Further to a previous submission (which can be ignored), I'd like the
following query to 'search' a
table
To: Rick Emery
Cc: [EMAIL PROTECTED]
Subject: Re: RE: [PHP-DB] Query construction
If you mean did the pattern I'm trying to match: $team, contain what I
though it should:
'footballSat' then yes it did. I also receieve no error message from
MySQl
The string in the table field I can view/alter
-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 9:19 AM
To: Rick Emery
Cc: [EMAIL PROTECTED]
Subject: Re: RE: [PHP-DB] Query construction
If you mean did the pattern I'm trying to match: $team, contain what I
though it should:
'footballSat' then yes
Usually what I do when I'm having this type of problem is put the whole
sql statement into a string variable then print the variable out just
before running the query so you know exactly what's being sent to mysql.
Then I log into mysql from the command line and enter the query manually
to
To: Rick Emery
Cc: [EMAIL PROTECTED]
Subject: Re: RE: RE: [PHP-DB] Query construction
I'm sorry but I must be missing something fundamental here. This is how my
code looks, and if the
SQL query yields nothing and emits no error (as it currently is) it simply
reverts to error.php:
$sql = SELECT * FROM
YES!!! Exactly
Russ...do what Steve syas...
-Original Message-
From: Steve Cayford [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 9:32 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Query construction
Usually what I do when I'm having
...
-Original Message-
From: Steve Cayford [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 9:32 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Query construction
Usually what I do when I'm having this type of problem is put the whole
sql
:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 9:56 AM
To: Rick Emery
Cc: [EMAIL PROTECTED]
Subject: Re: RE: [PHP-DB] Query construction
Ok ok ok!! Thank you both for the pointers, they did of course yield the
problem - as bloody always
it's something completely different! As my old-dad
of time...
p.s. Your father is a psychiatrist??? Now, there, I could use some help...
-Original Message-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 9:56 AM
To: Rick Emery
Cc: [EMAIL PROTECTED]
Subject: Re: RE: [PHP-DB] Query construction
Hi,
If I run a query;-
$result = mysql_query($query);
is there a way of deleting rows from $result after this runs. Or does
anyone have any idea of how $result is generally structured when
mysql_query($query) is run.
thanks
--
PHP Database Mailing List (http://www.php.net/)
To
instead of SELECT all_records WHERE some_condition, and then DELETE
certain_rows, couldn't you just do a DELETE FROM WHERE?
-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 14:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] query question
Hi,
If I
Subject: [PHP-DB] query question
Hi,
If I run a query;-
$result = mysql_query($query);
is there a way of deleting rows from $result after this runs. Or does
anyone have any idea of how $result is generally structured when
mysql_query($query) is run.
thanks
--
PHP Database Mailing Li
out those
rows you do not want.
rick
-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 8:21 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] query question
Hi,
If I run a query;-
$result = mysql_query($query);
is there a way of deleting rows from
ake your
selection criteria more precise. Then, fetch row by row to weed out those
rows you do not want.
rick
-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 8:21 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] query question
Hi,
If I run
]
-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 14:41
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] query question
I want to loop round $result fetching rows and if the current row is not
needed then removing it from $result, $result will then get used again
01 14:41
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] query question
I want to loop round $result fetching rows and if the current row is not
needed then removing it from $result, $result will then get used again but
with the said rows removed. I am trying to do this to avoid some major
code
changes w
PROTECTED]
-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 14:54
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] query question
yeh this would work, how can I assign the rows to a new array? Is each row
accessed as an element?
Jon Farmer [EMAIL PROTECTED
PM
Subject: [PHP-DB] Query construction (again)
Hey there folks - similar problem - different project!
I want to select some records for a period of 7days after their insert
[dateFrom] date.
Last time I asked you guys for help I was helped toward the following
solution:
$sql
PROTECTED]
Sent: Wednesday, August 22, 2001 10:16 PM
Subject: [PHP-DB] Query construction (again)
Hey there folks - similar problem - different project!
I want to select some records for a period of 7days after their insert
[dateFrom] date.
Last time I asked you guys for help I
Skickat: den 23 augusti 2001 11:46
Till: Gremlins Mailing List
Kopia: [EMAIL PROTECTED]
Amne: Re: [PHP-DB] Query construction (again)
(Apologies for cross-postings here but I lost a php-db list
members personal email address..)
I need a query that in English would read something like
Hey there folks - similar problem - different project!
I want to select some records for a period of 7days after their insert [dateFrom] date.
Last time I asked you guys for help I was helped toward the following solution:
$sql = SELECT * FROM $Tpostings WHERE now()=dateFrom AND now()dateTo;
- Original Message -
From: Russ Michell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 10:16 PM
Subject: [PHP-DB] Query construction (again)
Hey there folks - similar problem - different project!
I want to select some records for a period of 7days after
- Original Message -
From: Russ Michell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 10:16 PM
Subject: [PHP-DB] Query construction (again)
Hey there folks - similar problem - different project!
I want to select some records for a period of 7days after
Hi there people:
I have a MySQL table consisting of category names among other things.
I would like to be able to construct a query that tells me the number of times a
unique category
name occurs in the table:
//Table 'posts' from command-line
mysql explain posts;
-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: 21 August 2001 12:46
To: Lunny Damian
Subject: Re: RE: [PHP-DB] Query construction
Damian:
Thanks for that but it doesn't do what I wanted though. It
actually returns the first item ('some
stuff') from the table, where I
Damian
Cc: [EMAIL PROTECTED]
Subject: Re: RE: RE: [PHP-DB] Query construction
Damn!!
That'll be it..
I'm running phpMyAdmin 2.1.0 , php.4.0.3pl1 and MySQL 3.22.32
Then again I don't get an error message from your query..???
Perhaps it has to do with the query being embedded
At 1:44 PM +0100 8/21/01, Russ Michell wrote:
I always love that feeling when you beat a problem that refuses to go away.
So do I - but I aint beaten it yet! :-(
I'm still getting '2' as being the number of posts in each category
when '2' is actually only the
number of posts in *one* of the
PROTECTED]
Subject:Re: RE: RE: RE: [PHP-DB] Query construction
I always love that feeling when you beat a problem that refuses to go
away.
So do I - but I aint beaten it yet! :-(
I'm still getting '2' as being the number of posts in each category when
'2' is actually only
That Resource ID #2 is the connection or result set. You need to use the
connection to do a query, which returns a result set, then use the result
set to do fetches. Those will return an array of the stuff you really
wanted.
Could you give me an example?
Grant wrote:
That Resource ID #2 is the connection or result set. You need to use the
connection to do a query, which returns a result set, then use the result
set to do fetches. Those will return an array of the stuff you really
wanted.
This uses PostgreSQL, but the concepts are the same for MySQL.
On Fri, 17 Aug 2001, Alex wrote:
Could you give me an example?
Grant wrote:
That Resource ID #2 is the connection or result set. You need to use the
connection to do a query, which returns a result set, then use the result
I want to retrieve the last 15 days of data from a certain time but
not today's. I have this but it's still giving me today's data:
$today = date(Y-m-d);
$sql = SELECT volume, date, time, id
FROM $table_name
where time = $time1 and date != $today ORDER by id desc LIMIT 15;
(date != $today)
I am connecting to an Oracle 8 server using OCI, PHP and Apache on a RH
Linux 7.1 box.
All works well until I try to query an Oracle dynamic view like the
following:
$query = SELECT instance_name, host_name FROM v$instance;
When I execute this query, the server returns the following error.
on 8/6/01 5:33 PM, Rankin, Randy at [EMAIL PROTECTED] wrote:
When I execute this query, the server returns the following error.
Warning: OCIStmtExecute: ORA-00942: table or view does not exist in
/usr/local/apache/htdocs/oracle/oraprod.php on line 17
My suspicion is that PHP thinks that
Hello,
I've got a pretty basic query which I am trying to run within a function.
The query looks like this:
SELECT
a.title,a.alt_title,a.articleID,a.articleSectionID,sect.URLname
FROM
$articlestable a, $categorytable sect
WHERE
a.articleSectionID = sect.articleSectionID
How about declaring some of the variables as global variables.
regards
seriousj wrote:
Hello
I have a query that I have placed in a function that is in a file that I
include in the page to be displayed. It doesn't work. I know that the code
works because when I place the code in the page
Hi!
I've got two tables:
CREATE TABLE users (
user_id bigint(20) unsigned DEFAULT '0' NOT NULL,
contact_id bigint(20) unsigned DEFAULT '0',
user_login varchar(100) NOT NULL,
PRIMARY KEY (user_id),
UNIQUE UC_user_id (user_id)
Hello
I have a query that I have placed in a function that is in a file that I
include in the page to be displayed. It doesn't work. I know that the code
works because when I place the code in the page to be displayed directly it
works fine.
I can't figure it out. Thanks in advance for any help.
errr maybe
you need to pass the function the values of the variables you are using either by
declaring them global inside the function:
global $server,$user,$pass,$type_id;
or passing them to the function directly:
function type_select($server,$user,$pass,$type_id)
hope this helps :-)
At 19.06.2001 09:21, you wrote:
Hello
I have a query that I have placed in a function that is in a file that I
include in the page to be displayed. It doesn't work. I know that the code
works because when I place the code in the page to be displayed directly it
works fine.
I can't figure it out.
Hi there:
I'm stil having problems with this query in that it doesn't bring up any results!
Here is the select menu that refreshes the page and deposites the var: 'sortedBy'
into play:
form
select name=\sortMonth\ onChange=\MM_jumpMenu('parent',this,0)\;
option--select one--/option
option
and drop inside to create the query. that way you avoid an expensive if or
or or or ...
Steve
-Original Message-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: 26 April 2001 10:50
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Query problem cont'd..
Hi there:
I'm stil having
Hi all:
I'm using mysql-3.22.32:
My PHP-embedded query is as follows:
else if($sortBy == '01') {
$sql = SELECT * FROM $table_cal WHERE item_activity='$id' AND
DATE_FORMAT('item_date','%m') LIKE '$sortBy';
$sortBy = Month of January;
}
* '$sortBy' is equal to '01'.
*
I'd try adding:
$conn = odbc_connect("pruebas_php", "", "")
or die("cannot connect to pruebas_php");
$resultado1 = odbc_exec($conn,"SELECT Nombre, Apellido1, Apellido2 FROM
Personas")
or die ("cannot execute query");
--
Regards,
Gary "SuperID" Huntress
Hi,
I've got a table like:
id user_id ip time
1 2 127.0.0.1 20010316105018
Etc, etc.
I do a join on the this table and the users table to get the coresponding
username to user_id like this:
SELECT users.name AS name, user_logins.ip AS ip,
How do I get the query times echoed like this?
http://www.ub2k.com/alpha/UltraBoard.php
Thanks
--
Norman Tan
North Shore Interactive
http://www.nsmb.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Hey there fellow querieres
I summon your power! (eh..)
well.. enough with the nonsense :)
I have a littlebit of problem:
I am displaying 15 different newsarticles on a page.
The articles are displayed in three different tables.
First there`s one article (the main-top-story) that is shown
On 13 Feb 2001, at 11:41, Trond Erling Hundal wrote:
Hey there fellow querieres
I summon your power! (eh..)
well.. enough with the nonsense :)
I have a littlebit of problem:
I am displaying 15 different newsarticles on a page.
The articles are displayed in three different tables.
can anyone figure out why the following code works fine when both select
variables = "ALL" and also when only 1 of the 2 ="ALL" but NOT when BOTH
select variables equal something other than "ALL"?
here is the code:
What area of the city would you like to dine in?
?php
When I run any kind of query this is the value of result Resource id #2
Example
$result= mysql_query (" Select * from ACCT_TBL ") or die
("Error".mysql_error());
print result;
any ideas?
randy
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
Looks fine, now retrieve the rows from the query.
-Original Message-
From: Randy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 12:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] query error
When I run any kind of query this is the value of result
Oops. Seems to work when I put the pound sign in the front and back of the
date :-) Thanks.
John
When I try to query an Acess database for a particular date I get ODBC
errors indicating I'm screwing up the call. Can anyone give me an example
of
a select on a date field. Quotes make it think
201 - 284 of 284 matches
Mail list logo