Hello peppe,
Thursday, March 4, 2004, 11:28:30 AM, you wrote:
p Hi I have a table users with columns name email and access
p In email I have values [EMAIL PROTECTED] etc in access I have values 1,2,3,4,7,8
p How can I filter value 2 ?
p Beacause I need only users with value 2 to send email
SELECT
...
FROM users
WHERE FIND_IN_SET( 2, values ) 0
Ignatius
_
- Original Message -
From: peppe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 12:28
Subject: [PHP-DB] SELECT
Hi I have a table users with columns name email and access
The problem is in access values are like string 1,2,3,4,5
Richard Davey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hello peppe,
Thursday, March 4, 2004, 11:28:30 AM, you wrote:
p Hi I have a table users with columns name email and access
p In email I have values [EMAIL
Hi
I made this query
$sql= SELECT * FROM users WHERE FIND_IN_SET( 2, access ) 0 ;
$result = mysql_query($sql);
$numRows = mysql_num_rows($result);
for ($row =1; $row = $numRows; $row++) {
$rowArray = mysql_fetch_array($result);
$access1 = $rowArray[1];
if
??
Didn't you say that $access[1] contains sets such as 1,2,3,4,7,8?
Why compare it to 2?
_
- Original Message -
From: peppe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 13:22
Subject: Re: [PHP-DB] SELECT
Hi
I made this query
$sql
-
From: peppe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 13:22
Subject: Re: [PHP-DB] SELECT
Hi
I made this query
$sql= SELECT * FROM users WHERE FIND_IN_SET( 2, access ) 0 ;
$result = mysql_query($sql);
$numRows = mysql_num_rows($result
peppe schrieb:
for ($row =1; $row = $numRows; $row++) {
$rowArray = mysql_fetch_array($result);
$access1 = $rowArray[1];
Hi Peppe,
although I don't know the function mysql_fetch_array()...
why you use $rowArray[1], which is the first element (if $rowArray is of
type array).
why the backticks and not quotes ?
pete
Ma wrote:
hi!
do not quite understand your problem.. pls post some code?
heres a small snippet that should work well...
$qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`';
$res = mysql_query($qry);
while($customer =
From: pete M [EMAIL PROTECTED]
do not quite understand your problem.. pls post some code?
heres a small snippet that should work well...
$qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`';
$res = mysql_query($qry);
while($customer = mysql_fetch_object($res)) {
of reserved words and use well-formed names, with a
clear naming convention. Then you won't need backticks.
HTH
Ignatius
_
- Original Message -
From: pete M [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 1:58 PM
Subject: Re: [PHP-DB
From: Boyan Nedkov [EMAIL PROTECTED]
Putting more than one table in the FROM clause means tables are joined,
then at least following problems could arise:
- using WHERE clause you can have empty recordset returned and then
COUNT conflicts with it because there is actually no any data to be
hi!
do not quite understand your problem.. pls post some code?
heres a small snippet that should work well...
$qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`';
$res = mysql_query($qry);
while($customer = mysql_fetch_object($res)) {
echo stripslashes($res-customer).'br'.\n;
To: PHP-DB
Subject: Re: [PHP-DB] Select Value with 's
hi!
do not quite understand your problem.. pls post some code?
heres a small snippet that should work well...
$qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`'; $res =
mysql_query($qry); while($customer = mysql_fetch_object($res
From: Aleks @ USA.net [EMAIL PROTECTED]
First I build my select list:
SELECT NAME=Cid size=1
OPTION Selected VALUE=All Customers/OPTION
?
While ($Site = mysql_fetch_array($S))
{
$Sid = $Site[CID];
$SName = htmlspecialchars($Site[Customer]);
echo(option
(): supplied argument is not a valid MySQL result
-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 1:45 PM
To: Aleks @ USA.net; 'ma'; 'PHP-DB'
Subject: Re: [PHP-DB] Select Value with 's
From: Aleks @ USA.net [EMAIL PROTECTED
-0500
An: 'CPT John W. Holmes' [EMAIL PROTECTED], 'ma'
[EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED]
Betreff: RE: [PHP-DB] Select Value with 's
Thanks John for the answer But...
Now my select statement on the Result.php page errors out when
The value has the [']in it. What
Sorry I left out the exact form
It is
$info = mysql_query( Select * From customer Where customer.customer LIKE 'St
Mary's Hospital');
-Original Message-
From: ma [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 1:56 PM
To: PHP-DB
Subject: Re: [PHP-DB] Select Value
be easier if i knew the source code...
Von: Aleks @ USA.net [EMAIL PROTECTED]
Datum: Wed, 5 Nov 2003 14:01:37 -0500
An: 'ma' [EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED]
Betreff: RE: [PHP-DB] Select Value with 's
Sorry I left out the exact form
It is
$info = mysql_query( Select
it
-Original Message-
From: ma [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 2:07 PM
To: PHP-DB
Subject: Re: [PHP-DB] Select Value with 's
hi
ok - than make it this way:
$info = mysql_query( Select * From customer Where customer.customer LIKE St
Mary's Hospital);
anyways - shouldn't
['] is confusing it
-Original Message-
From: ma [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 2:07 PM
To: PHP-DB
Subject: Re: [PHP-DB] Select Value with 's
hi
ok - than make it this way:
$info = mysql_query( Select * From customer Where customer.customer LIKE St
-
From: ma [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 2:29 PM
To: PHP-DB
Subject: Re: [PHP-DB] Select Value with 's
hi
hm - it would help if you'd send us the code where you
generate the query
_ma
# life would be easier if i knew the source code...
Von: Aleks
-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 2:52 PM
To: PHP-DB
Subject: RE: [PHP-DB] Select Value with 's
Using your variables and query, the following, based on one of my own
functional pages, the following should work:
$FF = addslashes($_POST[Cid
You are most welcome, Aleks. Glad it helped.
-Original Message-
From: Aleks @ USA.net [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 3:01 PM
To: 'Hutchins, Richard'; 'PHP-DB'
Subject: RE: [PHP-DB] Select Value with 's
BINGO Thanks Rich... I just realized were I
Mark Gordon wrote:
I cannot seem to get a SELECT COUNT for a query from fields in two different tables and a WHERE clause. Does anyone know if this is not possible with php/mysql or am I doing something wrong? I have tried a number of variations on the following code:
$sql = SELECT COUNT(*),
Yes, query is definitely working without COUNT(*). Even in the most stripped down
form, the query fails:
$sql = SELECT COUNT(bandid), genre
FROM bands, genre;
$result=mysql_query($sql);
while ($gen=mysql_fetch_row($result)) {
echo $gen[1];
}
John W. Holmes [EMAIL PROTECTED] wrote:
Mark Gordon
Mark Gordon wrote:
Yes, query is definitely working without COUNT(*). Even in the most stripped down form, the query fails:
$sql = SELECT COUNT(bandid), genre
FROM bands, genre;
$result=mysql_query($sql);
while ($gen=mysql_fetch_row($result)) {
echo $gen[1];
}
Fails how? If it echos zero, it's
Putting more than one table in the FROM clause means tables are joined,
then at least following problems could arise:
- using WHERE clause you can have empty recordset returned and then
COUNT conflicts with it because there is actually no any data to be
returned;
- joining two (or more)
SUBSTRING()
_
- Original Message -
From: Shaun [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 29, 2003 11:57 AM
Subject: [PHP-DB] SELECT Part of a Field
Hi,
How can I SELECT a portion of a field in a table for example the first
character, or
Depending on the database you are using
Substring()
Substr()
Functions do what you want
jack
-Original Message-
From: Shaun [mailto:[EMAIL PROTECTED]
Sent: Friday, August 29, 2003 11:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] SELECT Part of a Field
Hi,
How can I SELECT a
:04 PM
To: John Ryan
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT FROM 2 or more tables
A join merges every record in one table with every record in another
table, which is something you rarely want to do. So you want to set a
filter on the merged records, which can be anything, but is usually
select t1.name,t2.salary from personal t1,sal t2
where t1.id=t2.id;
- Original Message -
From: John Ryan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 4:41 PM
Subject: [PHP-DB] SELECT FROM 2 or more tables
Is it easy?? Is it possible?? Should I just run 2
John,
It sounds like you need to read basic documentation on combining SQL queries.
Basically, you need to have a column that is common across both tables.
Eg., in TABLE1 have a column named TABLE1ID. Have the same ID cross referenced in TABLE2.
The ID would be sequenced in some way
A join merges every record in one table with every record in another
table, which is something you rarely want to do. So you want to set a
filter on the merged records, which can be anything, but is usually a
match between a field in one table and a field in another table.
That's a join in two
: Brent Baisley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 3:04 PM
To: John Ryan
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT FROM 2 or more tables
A join merges every record in one table with every record in another
table, which is something you rarely want to do. So you want
Hehe, ok, that was bad there for a second :)
Ben
-Original Message-
From: Brian Dailey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 3:24 PM
To: Ben Lake; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT FROM 2 or more tables
No, he meant rarely want to join entire tables
The internet is a wonderful resource.
http://www.mysql.com/doc/en/SELECT.html
Edward Dudlik
Becoming Digital
www.becomingdigital.com
Did I help you? Want to show your thanks?
www.amazon.com/o/registry/EGDXEBBWTYUU
- Original Message -
From: Artoo [EMAIL PROTECTED]
To: [EMAIL
Try this
$query = 'SELECT * FROM table
$mysql_result = mysql_query($query, $link);
while($row = mysql_fetch_array($mysql_result))
{
switch ($row[event] )
{
case event_one:
$bg = 'blue'
break;
.'
tdda da da nbsp;/td
/tr';
}// end while
?
Edward Dudlik
Becoming Digital
www.becomingdigital.com
- Original Message -
From: Peter Lovatt [EMAIL PROTECTED]
To: Christopher Lyon [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, 17 June, 2003 17:42
Subject: RE: [PHP-DB] Select
9:51 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Select Statement with output in different
colors.
Here's a slight alteration to Peter's code in case someone isn't
familiar with
switch statements. Ooh, such a bad pun, as if there's any other kind.
?
$query = 'SELECT * FROM table
On 13 Jun,2003 at 0:48 G E Holt wrote:
$resolved=$DB_site-query_first(SELECT * FROM country WHERE
'$resolvingip' BETWEEN ip_from AND ip_to);
Don't think you should have the '' around the ip number. Does that help?
Ronan
e: [EMAIL PROTECTED]
t: 01903 739 997
w: www.thelittledot.com
The
On Friday 13 June 2003 15:48, G E Holt wrote:
I hope this is something easy I am overlooking but here goes:
I have a table called: country which has the following fields:
FieldType
ip_from double(11,0)
ip_todouble(11,0)
country_code
Here's how I did it when playing with this...
Table definition:-
CREATE TABLE ip_list (
ip_from double default NULL,
ip_to double default NULL,
country_code char(2) default NULL,
country_name varchar(100) default NULL,
KEY ip_from (ip_from,ip_to,country_code,country_name)
)
Why not use the built-in conversion functions in mysql?
From the manual:
quote
INET_NTOA(expr)
Given a numeric network address (4 or 8 byte), returns the dotted-quad representation
of the address as a string:
mysql SELECT INET_NTOA(3520061480);
- 209.207.224.40
INET_ATON(expr)
Given
guess it is hard to answer this with so less information
first show us how the table defenition is... how it is build up and then
which fields you want to show to the user!
then I or others can help you much more!!
___
Mark Snijders, Developer
Atos Origin
: [PHP-DB] SELECT * FROM Command
guess it is hard to answer this with so less information
first show us how the table defenition is... how it is build
up and then
which fields you want to show to the user!
then I or others can help you much more
SELECT * FROM tablename WHERE zipcode='$zipcode' ORDER BY entered_date;
Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
Pay It Forward
mailto:[EMAIL PROTECTED]
http://accessingram.com
-Original Message-
From: Michelle Whelan [mailto:[EMAIL PROTECTED]
Sent:
--- Michelle Whelan [EMAIL PROTECTED] wrote:
-Ok, this is what I have. I hope this is what you are looking for.
I'm looking to format this search results page so that the
results come back with the entire entry that also matches the
zipcode that was searched.
ex: zipcode search =
Yes,
option value=? echo $row-id; ? ? echo $selected; ? selected
You've hardcoded selected there and also expect it to be set
dynamically.
--
Maxim Maletsky
[EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello PHP world!!! i've just finisched installing Apache 1.3.27
with PHP4 and 1.4 in Windows 2000. I've installed all off the scripts
that function all right in Linux Red Hat in Windows 2000, but when it
comes to do a simple select to a table that does exist and the select
is all right
PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 9:38 AM
Subject: RE: [PHP-DB] select date -MM mysql help
Sounds more like an SQL question than PHP, but try the following:
SELECT * FROM table WHERE date LIKE '2002-12%';
Regards,
Matthew Moldvan
Sounds more like an SQL question than PHP, but try the following:
SELECT * FROM table WHERE date LIKE '2002-12%';
Regards,
Matthew Moldvan
---
System Administrator
Trilogy International, Inc
http://www.trilogyintl.com/ecommerce/
On Wednesday 25 December 2002 00:10, zeroked wrote:
Hi I am a newbie to PHP so please help
How do I add information into my mysql db?
I have a db called sitedb and I want to insert datat into my news table
inside my sitedb.
Merry Christmas. You forgot to say what the problem is.
--
Jason
z mysql_query(INSERT INTO news (author, posted, body) VALUES($author,
z $posted, $body) );
I don't really know what the problem is, but you definitely need
to include quotation marks around the variables:
mysql_query(INSERT INTO news (author, posted, body)
VALUES('$author', $posted,
table includes identical fgnumber-faqid
rows.
:)
Hynek
-Original Message-
From: Ignatius Reilly [mailto:[EMAIL PROTECTED]]
Sent: 10. prosince 2002 23:42
To: [EMAIL PROTECTED]; Michael Knauf/Niles
Subject: Re: [PHP-DB] Select Query Help...
Try:
SELECT DISTINCT F.question, F.answer
Try:
SELECT DISTINCT F.question, F.answer
FROM Faqs AS F, FaqsRelatedToProducts Table AS FP
WHERE F.faqid = FP.faqid
DTH?
Ignatius
- Original Message -
From: Michael Knauf/Niles [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December
Does 'select * from table order by id desc limit 1' do what you want?
HTH
Rich
-Original Message-
From: Afif [mailto:[EMAIL PROTECTED]]
Sent: 21 November 2002 01:49
To: PHP DB
Subject: [PHP-DB] Select Last row
dear All,
I have data and I want to get the last row of my table.
how to
Can you reverse your sorting order? In that case, the last row now
becomes the first--making things much easier and faster! :-)
Marco
--
php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers
Come visit us at
Tyler,
You probably need one or two of the following:
1. Put single-quotes around case in your SQL (where type like 'case')
2. Use wild-cards in your where statement (where type like '%case%')
Good luck!
--Dave
On Wed, 2002-11-06 at 23:31, Tyler Whitesides wrote:
Hi,
Sorry if this is
Thank you putting '%case%' instead of case worked!
- Original Message -
From: David Smith [EMAIL PROTECTED]
To: Tyler Whitesides [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, November 06, 2002 10:47 PM
Subject: Re: [PHP-DB] Select Fields
Tyler,
You probably need one or two
What's the error?
-Original Message-
From: Steve Dodkins [mailto:Steve.Dodkins;ebm-ziehl.co.uk]
Sent: 25 October 2002 16:46
To: Php-Db (E-mail)
Subject: [PHP-DB] select statement
Hi
I get an error message with the following statement, if I remove the 'AND
Can you echo out the sql going in and any errors you're getting when the
query doesn't work then post that info to this list? It'll help both you and
us diagnose what might be going wrong. In addition, what datatype are the
columns named start and end in your database?
(Assuming database is
= $row[total_billable];
-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT statement problem
SELECT * FROM tickets_work
WHERE employee_id = '$tech_id' AND
start '$start
];
$total_billable = $row[total_billable];
-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT statement problem
SELECT * FROM tickets_work
WHERE employee_id = '$tech_id' AND
start
you maybe using it the wrong way. read the doc:
russ arbuthnot wrote:
I have a mysql table named equipment with 11 columns named: id,
staff_member, class, type, manufacturer, model, description, picture,
created, modified, and published.
I'm trying to write a select statement similar to
oops, i accidentally sent it without finishing...
anyway, what i wanted to say was DISTINCT, at least how i learned it, was
working with rows instead of colums:
http://www.mysql.com/doc/en/DISTINCT_optimisation.html
is there a reason why you dont want to list the columns?
russ arbuthnot
SELECT DISTINCT type,* FROM equipement WHERE class = microphones;
Ryan
-Original Message-
From: russ arbuthnot [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 12, 2002 12:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] select distinct with all columns
I have a mysql table named
or not be the correct function to use depending
on what your need is.
Ryan
-Original Message-
From: Ryan Jameson (USA)
Sent: Monday, August 12, 2002 12:22 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] select distinct with all columns
SELECT DISTINCT type,* FROM equipement WHERE class
Why not:
select * from table1 where table1.id != table2.id
or it may be necessary to incorporate a fragment of table2
select table1.8, table2.id from table1, table2 where table1.id !=
table2.id
Note this tests against only one the current table2.id, not all of them. So
: RE: [PHP-DB] select from two tables
Well, I'm just a beginner myself, but I would say that:
echoi by ; echo ($albumby[xoops_artist.artist]); echoibr;
should at least be:
echoi by ; echo ($album[xoops_artist.artist]); echoibr;
or even:
echoi by ; echo ($album[artist]); echoibr;
Hope
I would try replacing:
echoi by ; echo ($albumby[xoops_artist.artist]); echoibr;
with this:
echoi by ; echo $albumby[artist]; echoibr;
or even better this(notice the dots instead of different echos and the
single qoutes):
echo'i by '.$albumby[artist].'ibr';
I would say that you have a
Well, I'm just a beginner myself, but I would say that:
echoi by ; echo ($albumby[xoops_artist.artist]); echoibr;
should at least be:
echoi by ; echo ($album[xoops_artist.artist]); echoibr;
or even:
echoi by ; echo ($album[artist]); echoibr;
Hope this helps,
Herman
--
PHP Database
Ok I tired this but it did not help, but thank you.
-Original Message-
From: Herman Verkade [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 28 July 2002 1:18 a.m.
To: 'Barry Rumsey'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] select from two tables
Well, I'm just a beginner myself, but I
Hi Barry
$query = SELECT * FROM xoops_album,xoops_artist WHERE
xoops_album.artist_id = xoops_artist.artist_id;
If you only need two fields, it is not necessary to retrieve all
fields
$query = SELECT xoops_album.album, xoops_artist.artist
FROM xoops_album, xoops_artist
WHERE
From: Clive Bruton [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 10:24 PM
Joakim, thanks, that sorted it. Just one note, numrows in
the sql query
should be num_rows? That's how I got it to work anyway.
Yes, that's totally correct. Just a typo.
Joakim
--
PHP Database Mailing
From: Clive Bruton [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 5:01 PM
How do I get both the number of rows found (5,000) and get a
subset of
the records (ie 0-9, 10-19, 20-29...) so that a user can
browse through
the records rather than getting 5,000 at a time (but still
[EMAIL PROTECTED] wrote at 16/07/02 09:44
$result = mysql_query(SELECT COUNT(*) as numrows FROM
table,$db);
$row = mysql_fetch_array($result);
$num_rows = $row['num_rows'];
Joakim, thanks, that sorted it. Just one note, numrows in the sql query
should be num_rows?
I think the paging function is what you want
SELECT * from table limit 0,10
for the first ten records
SELECT * from table limit 11,20
for the next ten, etc.
Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
Pay It Forward
mailto:[EMAIL PROTECTED]
http://accessingram.com
Adam Alkins wrote at 15/07/02 04:06
mysql_num_rows just counts the amount of rows in a query, so if you only
selected 10 rows, it will return 10.
If you want to count all the rows in the table, its best to use the COUNT()
function
SELECT COUNT(*) FROM table
In my example, I've selected all
ie start at record 10 and show the next 10. But this delivers back 10
as the $num_rows variable, when I want the total number of rows.
I don't really have to complete two querys to get the appropriate values
do I?
mysql_num_rows just counts the amount of rows in a query, so if you only
$login = mysql_query(SELECT * FROM Users WHERE Username ='$User_Name');
-Original Message-
From: Shiloh Madsen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 4:48 PM
To: php-db
Subject: [PHP-DB] Select string.
Yet another thing i need some quick help with. What is
There are many ways to sort by date. I use something like this
SELECT * FROM newsitems WHERE newsdate=(whatever date you want);
For selecting records for the current date I use php's date function to
get the current date in the right format.
$current_date = date(Ymd);
SELECT * FROM newsitems
First: show us your exact query
Second: show us your exact error response
Third: show us your exact code and table structure
-Original Message-
From: Sander Peters [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 3:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] select rows from
Hi!
I think I have solved your problem...
I have attached an sql file to create the sample DB I created for my test
and a PHP file for you to run to see how I have implemented it.
First create the tables with the .sql file an then execute the .php file
from your browser.
Hope these help.
I think I forgot something usefull...
- Original Message -
From: Beau Lebens [EMAIL PROTECTED]
To: PHP DB (E-mail) [EMAIL PROTECTED]
Sent: Thursday, February 21, 2002 3:59 AM
Subject: [PHP-DB] SELECT where something exists but something else does not
Hey guys,
I am a little stuck
select * from tablename where field NOT LIKE %A%;
-Original Message-
From: Dave Carrera [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 12:39 PM
To: php List
Subject: [PHP-DB] Select rows where ?
Hi All
How do I select the rows that DO NOT contain a certain character.
I.e.
select * from table where columnsomething
select * from table where column NOT LIKE %something%
Jim Lucas
- Original Message -
From: Dave Carrera [EMAIL PROTECTED]
To: php List [EMAIL PROTECTED]
Sent: Tuesday, February 12, 2002 10:39 AM
Subject: [PHP-DB] Select rows where ?
Hi All
SELECT * FROM table WHERE COLUMN_NAME NOT LIKE '%unwanted_String%';
when the field type is number you can use
SELECT * FROM table WHERE COLUMN_NAME != unwanted_number;
or
SELECT * FROM table WHERE COLUMN_NAME unwanted_number;
Gurhan
-Original Message-
From: Dave Carrera
Did you print out the value of $sql before executing it? Was it as you
expected?
If so, did you print out mysql_num_rows() to verify it's greater than 0?
-Original Message-
From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 2:52 PM
To: [EMAIL PROTECTED]
Is your id an integer or a char/varchar? If it is an integer, take the
quotes off $id in your select statement.
Todd Williamsen [EMAIL PROTECTED] said:
Weird..
I want to be able to edit records, which I have done in the past, and I
cannot see why it isn't working... I have tried
I am assuming that this code is NOT the file do_mod_job.php.
What happens if you do this next line right after you execute your query?:
echo 'num rows fetched: '.mysql_num_rows($result).'br';
also, the while loop shouldn't really be necessary as the query should only
return one record if I
oops.forgot a semicolon on the first line of the multi-line code
segment
-Original Message-
$row = mysql_fetch_array($result)
echo 'tabletrthcolumn/ththvalue/th/tr';
while(list($key, $val) = each($row)) {
// $row has two key/value pairs per column -- one integer,
one
Check the manual for the mysql_fetch_array() function, it shows you how to
extract data from $result. You will use the while loop (as shown in the
manual's example) to fill your combo box / selct list /drop down menu,
whatever we're calling that creature today.
Miles
At 12:45 PM 1/30/2002
?
$db = mysql_connect($dbserver, $dbuser, $dbpass);
mysql_select_db($dbname,$db);
$sortby = name ASC;
$sql=SELECT * FROM webl_players ORDER BY $sortby;
$result=mysql_query($sql,$db);
print select name=canidate;
while( $row = mysql_fetch_array($result) )
{
$FirstName = $row['FirstName'];
You will need to put the option tag in a loop to get all of the records in
the table.
select name=canidate (this can go anywhere but in while loop)
?
$db = mysql_connect($dbserver, $dbuser, $dbpass);
mysql_select_db($dbname,$db);
$sortby = name ASC;
$sql=SELECT * FROM webl_players ORDER BY
Nope, that doesn't work
-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 1:01 PM
To: 'Todd Williamsen'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Select statement only returns 1 record
?
$db = mysql_connect($dbserver, $dbuser, $dbpass
http://www.mysql.com/doc/U/P/UPDATE.html
UPDATE catalogs SET PROCESSED = Y WHERE PROCESSED IS NULL LIMIT $i,10
Is this what you are looking for?
Robert V. Zwink
http://www.zwink.net/daid.php
-Original Message-
From: James Kupernik [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 21,
George,
Whether you can select into an array directly depends on your database.
In any case, PHP executes database queries and returns a handle or
container which is accessed as an array.
Here's the example from
http://www.php.ca/manual/en/function.mysql-fetch-array.php
?php
Hi Beau--
This is just a wild guess (I've only glanced at your SQL), but do you have
two locations in your locations table?
You might want to try yanking locations out of the join since you're not
using it in your WHERE clause or showing any info from it.
Doug
At 12:06 PM 8/30/01 +0800, Beau
-
// From: Doug Semig [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 30 August 2001 12:31 PM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] SELECT giving too much :)
//
//
// Hi Beau--
//
// This is just a wild guess (I've only glanced at your SQL),
// but do you have
// two locations in your
Hi Beau--
Alternatively you could probably include an AND for the location ID to link
up with whatever it is supposed to link up to in the WHERE clause.
But I have no idea how you responded to my message in 2 minutes flat! Are
you a remarkably complex AI autoresponder that knocks the socks off
101 - 200 of 221 matches
Mail list logo