RE: [PHP-DB] Using an array(-ish) in SQL queries

2004-11-02 Thread -{ Rene Brehmer }-
so close heh ... thanks mate :)
and whether they're to actually be deleted, that depends on the application 
... I have a few different where I use it.

Rene
At 02:13 03-11-2004, Bastien Koert wrote:
DELETE FROM the_table WHERE `ID` IN(1,2,3,4,5,6) will work just fine. The 
trick is to be sure that
those records indeed are to be deleted. I prefer to mark the record as 
deleted for a time before permanent deletion. That way its recoverable 
should something really bad happen.

bastien
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Using an array(-ish) in SQL queries

2004-11-02 Thread -{ Rene Brehmer }-
At 02:37 03-11-2004, Jennifer Goodie wrote:
[snip]
> My current version generates, for multi-select cases, queries like this:
>
> DELETE FROM the_table WHERE `ID`='1' OR ID`='2' OR `ID`='3' OR `ID`='4' OR
> `ID`='5' OR `ID`='6'
>
> or similar with the SELECT statement.
[snip lots of stuff]
> DELETE FROM the_table WHERE `ID` ISIN(1,2,3,4,5,6)
use IN  http://dev.mysql.com/doc/mysql/en/Comparison_Operators.html#IDX1268
If you know all the values in the array are escaped and safe you can just 
use implode() to make the list for IN

$string = implode("','",$array);
$sql = "SELECT FROM $table WHERE col_name IN('$string')";
Notice I added single quotes around the string, that is because they will 
be missing since implode only sticks the string between array elements.

However, you'd need a join that makes sense for a multi-table delete.  I 
don't know if it will work with a union, I have never tried, maybe somone 
else will chime in.
thanks a whole bunch ... can't believe how close I was ... and I couldn't 
even find it in the manual :-/

and for some reason I've never thought of implode :-s ... anyways, live and 
learn ...

thanks :)
Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Using an array(-ish) in SQL queries

2004-11-02 Thread Jennifer Goodie
 -- Original message --
From: -{ Rene Brehmer }- <[EMAIL PROTECTED]>
> Task at hand: deleting or selecting (same difference) several numbers of 
> records using only 1 query.
> 
> My first version simply looped through all the ticked off IDs and ran a 
> single query for each delete routine. I've still not suceeded in getting 
> the delete queries to work on multiple tables at once, despite the column 
> names being the same. But besides this:

Multi-table deletes are new to mySQL 4.0, so if you are running a 3.x release they 
won't work. 
http://dev.mysql.com/doc/mysql/en/DELETE.html 

> 
> My current version generates, for multi-select cases, queries like this:
> 
> DELETE FROM the_table WHERE `ID`='1' OR ID`='2' OR `ID`='3' OR `ID`='4' OR 
> `ID`='5' OR `ID`='6'
> 
> or similar with the SELECT statement.
[snip lots of stuff]
> DELETE FROM the_table WHERE `ID` ISIN(1,2,3,4,5,6)

use IN  http://dev.mysql.com/doc/mysql/en/Comparison_Operators.html#IDX1268

If you know all the values in the array are escaped and safe you can just use 
implode() to make the list for IN

$string = implode("','",$array);
$sql = "SELECT FROM $table WHERE col_name IN('$string')";
Notice I added single quotes around the string, that is because they will be missing 
since implode only sticks the string between array elements.

However, you'd need a join that makes sense for a multi-table delete.  I don't know if 
it will work with a union, I have never tried, maybe somone else will chime in.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Using an array(-ish) in SQL queries

2004-11-02 Thread Bastien Koert
DELETE FROM the_table WHERE `ID` IN(1,2,3,4,5,6) will work just fine. The 
trick is to be sure that
those records indeed are to be deleted. I prefer to mark the record as 
deleted for a time before permanent deletion. That way its recoverable 
should something really bad happen.

bastien

From: -{ Rene Brehmer }- <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: [PHP-DB] Using an array(-ish) in SQL queries
Date: Wed, 03 Nov 2004 01:29:20 +0100
X-posted to MySQL and PHP DB
Hi gang
Task at hand: deleting or selecting (same difference) several numbers of 
records using only 1 query.

My first version simply looped through all the ticked off IDs and ran a 
single query for each delete routine. I've still not suceeded in getting 
the delete queries to work on multiple tables at once, despite the column 
names being the same. But besides this:

My current version generates, for multi-select cases, queries like this:
DELETE FROM the_table WHERE `ID`='1' OR ID`='2' OR `ID`='3' OR `ID`='4' OR 
`ID`='5' OR `ID`='6'

or similar with the SELECT statement.
On some occasions this can result in a very large amount of OR statements, 
like for 50 IDs totally.

I've been reading through the MySQL manual and the comments in the select 
and delete parts, but cannot seem to find any mentioning of an easier way 
to do this. Or it's been deluting me cuz English is my second language, so 
the MySQL manual doesn't always make much sense to me.

I'm looking for something like passing on an array (as comma-seperated-list 
maybe), and then just do statements like:

DELETE FROM the_table WHERE `ID` ISIN(1,2,3,4,5,6)
Did I totally miss that part of the manual, or is it just not possible with 
MySQL ?

Now, for my script it doesn't really matter much which approach to use, but 
was more thinking performance wise it ought to be faster and less taxing 
for the server to parse an SQL statement that's closer to table structure, 
rather than the OR statements that has to be transformed first.

Sorry if I'm just a blind mouse that can't seem to find things in the MySQL 
manual. It's not really my best friend...

TIA
Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Using an array(-ish) in SQL queries

2004-11-02 Thread -{ Rene Brehmer }-
X-posted to MySQL and PHP DB
Hi gang
Task at hand: deleting or selecting (same difference) several numbers of 
records using only 1 query.

My first version simply looped through all the ticked off IDs and ran a 
single query for each delete routine. I've still not suceeded in getting 
the delete queries to work on multiple tables at once, despite the column 
names being the same. But besides this:

My current version generates, for multi-select cases, queries like this:
DELETE FROM the_table WHERE `ID`='1' OR ID`='2' OR `ID`='3' OR `ID`='4' OR 
`ID`='5' OR `ID`='6'

or similar with the SELECT statement.
On some occasions this can result in a very large amount of OR statements, 
like for 50 IDs totally.

I've been reading through the MySQL manual and the comments in the select 
and delete parts, but cannot seem to find any mentioning of an easier way 
to do this. Or it's been deluting me cuz English is my second language, so 
the MySQL manual doesn't always make much sense to me.

I'm looking for something like passing on an array (as comma-seperated-list 
maybe), and then just do statements like:

DELETE FROM the_table WHERE `ID` ISIN(1,2,3,4,5,6)
Did I totally miss that part of the manual, or is it just not possible with 
MySQL ?

Now, for my script it doesn't really matter much which approach to use, but 
was more thinking performance wise it ought to be faster and less taxing 
for the server to parse an SQL statement that's closer to table structure, 
rather than the OR statements that has to be transformed first.

Sorry if I'm just a blind mouse that can't seem to find things in the MySQL 
manual. It's not really my best friend...

TIA
Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] How to get unique entries?

2004-11-02 Thread Bastien Koert
select distinct(datefield) from 
bastien

From: "Chris Payne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: [PHP-DB] How to get unique entries?
Date: Tue, 2 Nov 2004 17:24:48 -0500
Hi there everyone,

I’m listing entries by date in a dropdown box, but on some days there are
7-8+ dates the same, but I just need it to display each date ONCE in the
dropdown, but for the life of me I can’t remember the command to use to do
this, can anyone please remind me?  I know it was dead simple, but can’t
remember the command.

Thank you.

Chris
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Mysql Function to display number of records

2004-11-02 Thread Bastien Koert
use the offset parameter
$offset = 0;  //and is set from the application
SELECT * FROM blah WHERE something<>0 LIMIT $offset , 5;
bastien
From: [EMAIL PROTECTED] (Jovan Ross)
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Mysql Function to display number of records
Date: 2 Nov 2004 20:28:41 -
I have a query that uses a LIMIT clause. Let's say it looks like this:
SELECT * FROM blah WHERE something<>0 LIMIT 5;
Ok, now my table really has 20 rows that satisfy the WHERE statement but I 
only retrieved 5. There was a function/statement that I could use to find 
out the total number of rows that would have been returned had I not used 
the LIMIT clause. Does anyone know what the statement was? I forget.

Yes, I'm using PHP btw.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Database Design Recommendations

2004-11-02 Thread -{ Rene Brehmer }-
At 23:36 01-11-2004, Eric Cranley wrote:
I tried to find this in the archives. If I missed it, my apologies in
advance.
I'm developing an intranet for my company, and we are planning on putting
sensitive information on it. I've already setup a login system using
sessions, but I'm not sure how to manage and store permissions, such as who
can view commissions, reset user passwords, etc. I've devised two methods,
but I have a feeling there's a better way to do this that I'm not thinking
of. I'll be storing these permissions in a MySQL database.
My first idea was a single field with the SET datatype. This allows for a
user to have multiple permissions, but makes it hard for other employees to
add permissions later, if they decide to restrict a previously open access
page. (I should mention that I'm the only person here who knows how to
adjust a table in MySQL, and I won't be around forever.)
My other idea solved the previously mentioned problem. I could create a
second table with employee permissions. It would have two fields,
employee_id and permission. Every employee would have one row for every
permission they had. I could also create a third table of page names and
required permission to view it, so if someone later decides that only
certain people should view a page, they can change it without coming to me.
What do people think of these ideas, and is there a better way to do this?
Thanks in advance.
Eric Cranley
IT Specialist
Willis Music Company
Firstly, the built-in PHP sessions are not the best to secure sensitive 
information because of how they generate and maintain the sessionIDs, 
they're fine for keeping information between page scripts, but not 
recommended for controlling access to anything. I always recommend against 
using them for anything that requires login. Instead, my recommendation, 
and that of several others, is to use a session table in the database, 
where the sessionID you generate is paired with the actual userID, and the 
sessionID is then sent to the user in a cookie. How to generate the 
sessionIDs are really up to, the important part is that they're unique. In 
my systems, I use the user's loginID, the user's browser agent ID, as well 
as other gathered information, then piece all of this together into 1 
string, MD5 it, then add a very long string of random characters to it, md5 
it again, and then chop out 256 chars, and use those as the session ID. The 
ID is then stored in the session table, with the userID, login time, login 
IP, and other data needed for security purposes. It also has a field for 
last action time, which is updated on each page load. When a user is 
inactive for 1 hour (in my case, you can reduce this to 20 mins or less, 
although going under 20 mins is not recommended as it may be impossible to 
read a page without having to login again to view the next), the ID 
expires. If the same user logs in from a different browser session, a new 
session ID is generated, and the old ones killed and terminated, making all 
the other sessions invalid. Every time a user logs in, and out, this 
information is logged. On every login and manual logout, the system clears 
the session table for all session IDs for that user. The logged information 
is stored in seperate table.

The system I made checks the cookie against the active sessions, and 
lockout the page entirely if it can't find a match. Meaning all it loads is 
a login box, the reduced menu for non-logged in users, and a "You do not 
have permission to view this page". I also make my scripts so only the 
parts of a page or form that the user can actually use is generated and 
loaded. Thus they can't see the options they don't have permission to use. 
This reduces the risk of people knowing that a certain functionality 
exists, and thus try to gain access to that functionality.

Secondly, having a boolean field for each perm in the user table is my 
recommendation. You can also do group based perms, where you have a table 
with a row for each group, and a boolean for each perm that group can be 
set to. Or a combination of both. I use both user and group based perms, 
where the user "allow" settings override the group's "not allowed" 
settings. In my forum system, I've got a per forum based perm system, where 
each forum has a row for each group in a seperate table. This means that 
each group can have different perms for each forum. This method is easily 
adapted to other kinds of systems.

Not sure this helps, but hope it does. Personally I would not use any 
publicly known method of maintaining sessions for anything containing 
sensittive information. The risk of someone figuring out how to circumvent 
it is too great. My forum/community system login covers large amounts of 
personal information, as well as private correspondance. I've made it so 
that even the system administrators do not have access  to any of this 
information unless the users grant their profile access to it. Only way to 
see it would be 

Re: [PHP-DB] How to get unique entries?

2004-11-02 Thread Jason Wong
On Tuesday 02 November 2004 22:24, Chris Payne wrote:

> Iâm listing entries by date in a dropdown box, but on some days there are
> 7-8+ dates the same, but I just need it to display each date ONCE in the
> dropdown, but for the life of me I canât remember the command to use to do
> this, can anyone please remind me?  I know it was dead simple, but canât
> remember the command.

google > sql unique

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
It is Fortune, not Wisdom, that rules man's life.
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] How to get unique entries?

2004-11-02 Thread Chris Payne
Hi there everyone,

 

I’m listing entries by date in a dropdown box, but on some days there are
7-8+ dates the same, but I just need it to display each date ONCE in the
dropdown, but for the life of me I can’t remember the command to use to do
this, can anyone please remind me?  I know it was dead simple, but can’t
remember the command.

 

Thank you.

 

Chris


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004
 


Re: [PHP-DB] Database Design Recommendations

2004-11-02 Thread Miles Thompson
Eric,
Your second approach is fine. It's denormalized, extensible, and can be 
manipulated using tools you put in place.

You may want to consider "groups" as well, thus people belonging to a group 
could view/edit pages, that has  the potential to save a lot of 
administrative scut work.

A table of permissions will also be required so that the various codes used 
for differing levels of permission are consistent. Suggest that when a user 
logs in the appropriate permission levels etc. should be fetched and stored 
in a session to save on some trips to the server. This session data, 
creatively used, could mean that only the files/pages that user is 
authorized for will be displayed.

Miles
At 06:36 PM 11/1/2004, Eric Cranley wrote:
I tried to find this in the archives. If I missed it, my apologies in
advance.
I'm developing an intranet for my company, and we are planning on putting
sensitive information on it. I've already setup a login system using
sessions, but I'm not sure how to manage and store permissions, such as who
can view commissions, reset user passwords, etc. I've devised two methods,
but I have a feeling there's a better way to do this that I'm not thinking
of. I'll be storing these permissions in a MySQL database.
My first idea was a single field with the SET datatype. This allows for a
user to have multiple permissions, but makes it hard for other employees to
add permissions later, if they decide to restrict a previously open access
page. (I should mention that I'm the only person here who knows how to
adjust a table in MySQL, and I won't be around forever.)
My other idea solved the previously mentioned problem. I could create a
second table with employee permissions. It would have two fields,
employee_id and permission. Every employee would have one row for every
permission they had. I could also create a third table of page names and
required permission to view it, so if someone later decides that only
certain people should view a page, they can change it without coming to me.
What do people think of these ideas, and is there a better way to do this?
Thanks in advance.
Eric Cranley
IT Specialist
Willis Music Company
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Mysql Function to display number of records

2004-11-02 Thread Jovan Ross
I have a query that uses a LIMIT clause. Let's say it looks like this:
SELECT * FROM blah WHERE something<>0 LIMIT 5;
Ok, now my table really has 20 rows that satisfy the WHERE statement but I 
only retrieved 5. There was a function/statement that I could use to find 
out the total number of rows that would have been returned had I not used 
the LIMIT clause. Does anyone know what the statement was? I forget.

Yes, I'm using PHP btw.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Database Design Recommendations

2004-11-02 Thread Hutchins, Richard
Eric,

There are, as you will find out, a number of ways you could handle it. The
"right" way is really your decision and it's directly related to the
flexibility, maintainability, and security your site will require.

I have had success in the past using a role-based permission system. For
example, I'd create a role called Administrator and give that role
permission to insert, update, delete, and select from every single table in
the application/intranet. Then, I'd create another group called, for
example, Newsreaders that only had permission to select from a table a with
news items in it. They wouldn't be able to add or edit news items and they
wouldn't be able to view any other information that didn't come from the
newsitems table.

When users logged in and were authenticated, they'd be assigned one or more
of the roles that exist. And in the session framework, on each page that had
to restrict access, I'd check the session variables $_SESSION["isadmin"] or
$_SESSION["isnewsreader"] or whatever to make sure that they were members of
the proper role to view that page.

Of course, you need to build the Administrator interface that would allow
the Administrator to assign users to roles in order to maintain all of the
roles your application/intranet may need. You could do this on the command
line in MySQL, but I think the extra effort to code it into a friendly web
page would pay off in maintainability and usability by someone other than
yourself.

Now, this may not be the most secure way of controlling access, but it was
appropriate for the application I was working on. You may also want to do a
Google search and see what kinds of pre-build session handling tools are
available. That may save you the time of building one from scratch and
troubleshooting it.

Good luck.

Rich

-Original Message-
From: Eric Cranley [mailto:[EMAIL PROTECTED]
Sent: Monday, November 01, 2004 5:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Database Design Recommendations


I tried to find this in the archives. If I missed it, my apologies in
advance.

I'm developing an intranet for my company, and we are planning on putting
sensitive information on it. I've already setup a login system using
sessions, but I'm not sure how to manage and store permissions, such as who
can view commissions, reset user passwords, etc. I've devised two methods,
but I have a feeling there's a better way to do this that I'm not thinking
of. I'll be storing these permissions in a MySQL database.

My first idea was a single field with the SET datatype. This allows for a
user to have multiple permissions, but makes it hard for other employees to
add permissions later, if they decide to restrict a previously open access
page. (I should mention that I'm the only person here who knows how to
adjust a table in MySQL, and I won't be around forever.)

My other idea solved the previously mentioned problem. I could create a
second table with employee permissions. It would have two fields,
employee_id and permission. Every employee would have one row for every
permission they had. I could also create a third table of page names and
required permission to view it, so if someone later decides that only
certain people should view a page, they can change it without coming to me.

What do people think of these ideas, and is there a better way to do this?
Thanks in advance.

Eric Cranley
IT Specialist
Willis Music Company

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Database Design Recommendations

2004-11-02 Thread Eric Cranley
I tried to find this in the archives. If I missed it, my apologies in
advance.

I'm developing an intranet for my company, and we are planning on putting
sensitive information on it. I've already setup a login system using
sessions, but I'm not sure how to manage and store permissions, such as who
can view commissions, reset user passwords, etc. I've devised two methods,
but I have a feeling there's a better way to do this that I'm not thinking
of. I'll be storing these permissions in a MySQL database.

My first idea was a single field with the SET datatype. This allows for a
user to have multiple permissions, but makes it hard for other employees to
add permissions later, if they decide to restrict a previously open access
page. (I should mention that I'm the only person here who knows how to
adjust a table in MySQL, and I won't be around forever.)

My other idea solved the previously mentioned problem. I could create a
second table with employee permissions. It would have two fields,
employee_id and permission. Every employee would have one row for every
permission they had. I could also create a third table of page names and
required permission to view it, so if someone later decides that only
certain people should view a page, they can change it without coming to me.

What do people think of these ideas, and is there a better way to do this?
Thanks in advance.

Eric Cranley
IT Specialist
Willis Music Company

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Problem with script

2004-11-02 Thread Peter Lovatt

Try echoing the actual query being run. It will give you more info to work
with.

Peter




> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: 02 November 2004 16:42
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Problem with script
>
>
> Hi all, greetings from Phoenix, Arizona!
> I'm having a problem with a PHP script and the database it manages.
> I'm having his error message:
>
> Query failed: You have an error in your SQL syntax. Check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> 't read card','1099413551')' at line 1
>
> I don't know what is happening, usually the database works well but
> sometimes this strange error appears. I'm sending you the scripts in where
> I think the error could be.
>
> Any suggestion or comment will be very appreciated.
>
> Thanks
>
> Renato

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Problem with script

2004-11-02 Thread Russell Johnson
Just looking at the error message shows why it's failing in this case: "'t read 
card','1099413551')' at line 1" One of the fields you're trying to insert is likely 
'Can't read card', and since in the query you are surrounding it with single quotes, 
and it's coughing on the word Can't , which has a single quote.

Check out the add_slashes($str) function, which will add a backslash before the single 
quote, e.g., 'Can\'t read card'.  That should do the trick.

- Russ

-Mensaje original-
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Enviado el: Tuesday, November 02, 2004 5:42 PM
Para: [EMAIL PROTECTED]
Asunto: [PHP-DB] Problem with script


Hi all, greetings from Phoenix, Arizona!
I'm having a problem with a PHP script and the database it manages.
I'm having his error message:

Query failed: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
't read card','1099413551')' at line 1

I don't know what is happening, usually the database works well but
sometimes this strange error appears. I'm sending you the scripts in where
I think the error could be.

Any suggestion or comment will be very appreciated.

Thanks

Renato

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Problem with script

2004-11-02 Thread Robby Russell
On Tue, 2004-11-02 at 10:41 -0600, [EMAIL PROTECTED]
wrote:
> Query failed: You have an error in your SQL syntax. Check the manual
> that
> corresponds to your MySQL server version for the right syntax to use
> near
> 't read card','1099413551')' at line 1

My initial guess is that you do not have magic quotes on.

You might want to validate your data before inserting it into the
database.

Try: http://us2.php.net/manual/en/function.mysql-escape-string.php

Any instances of "'" will break your INSERT query the way you have
it..so you need to insert them all with \' (which escapes the single
quotes)

hth,

Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


RE: [PHP-DB] Problem with script

2004-11-02 Thread Bastien Koert
from the brief error message your provided, I think its blowing up on the 
single quote contained in the word "can't". you need to handle this by 
choosing one a few of these methods

replace all single quotes with two single quotes
$text = str_replace("'","''", $text);
addslashes function
$text = addslashes($text);
or mysql_real_escape_string($sql);
bastien
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Problem with script
Date: Tue, 2 Nov 2004 10:41:35 -0600 (CST)
Hi all, greetings from Phoenix, Arizona!
I'm having a problem with a PHP script and the database it manages.
I'm having his error message:
Query failed: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
't read card','1099413551')' at line 1
I don't know what is happening, usually the database works well but
sometimes this strange error appears. I'm sending you the scripts in where
I think the error could be.
Any suggestion or comment will be very appreciated.
Thanks
Renato
<< submit_temp.php >>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] MySQL data harvester

2004-11-02 Thread Bastien Koert
write a script that will access the information, then use a CRON to schedule 
the collection at whatever intervals suite your needs.

Bastien
From: "Perry, Matthew (Fire Marshal's Office)" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL data harvester
Date: Tue, 2 Nov 2004 10:05:50 -0600
My office purchased 21 fascinating cell phones that have GPS locaters and
bar codes.

When we scan a bar code with one of these cell phones, the data is sent to 
a
third party company; information about this scan is stored on their
database.

I have installed a "harvester" on my pc that downloads this data off of the
third party database into my own MySQL database.
I want to link this data with my other tables to modify my inventory
information.

What is the best way to continuously update all tables when new 
transactions
occur?  With MS SQL Server or ORACLE I would write a stored procedure or
trigger that could do this.

What tools can I use with MySQL instead of procedures or triggers?

Matthew
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Problem with script

2004-11-02 Thread renato . linux
Hi all, greetings from Phoenix, Arizona!
I'm having a problem with a PHP script and the database it manages.
I'm having his error message:

Query failed: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
't read card','1099413551')' at line 1

I don't know what is happening, usually the database works well but
sometimes this strange error appears. I'm sending you the scripts in where
I think the error could be.

Any suggestion or comment will be very appreciated.

Thanks

Renatoquery($query);

$query2 = "SELECT contact_id FROM ".$tbl_prefix."contact WHERE 
contact_name = '".$_POST['contacto']."'";

$result2 = $myDB->query($query2);

while ($row = mysql_fetch_assoc($result2))

{

$contact_id = $row['contact_id'];

}

$query3 = "INSERT INTO ".$tbl_prefix."tmp (contact_id, order_brand, 
order_model, order_serialnumber, order_identification, order_description, order_date, 
session_id) ";

$query3 .= "VALUES 
('".$contact_id."','".$_POST['marca']."','".$_POST['modelo']."','".$_POST['nserie']."','".$_POST['identificacion']."','".$_POST['descripcion']."','".time()."','".$_GET['session_id']."')";

$result3 = $myDB->query($query3);

$mylocation = "rma.php?page=form.php&new=yes";

print "\n";

print "window.location=\"".$mylocation."\";\n";

print "\n";

}

elseif ($_GET['new'] == "yes")

{

$query = "SELECT contact_id FROM ".$tbl_prefix."contact WHERE 
session_id = '".$_GET['session_id']."'";

$result = $myDB->query($query);

while ($row = mysql_fetch_assoc($result))

{

$contact_id = $row['contact_id'];

}

$query2 = "INSERT INTO ".$tbl_prefix."tmp (contact_id, order_brand, 
order_model, order_serialnumber, order_description, order_date, session_id) ";

$query2 .= "VALUES 
('".$contact_id."','".$_POST['marca']."','".$_POST['modelo']."','".$_POST['nserie']."','".$_POST['descripcion']."','".time()."','".$_GET['session_id']."')";

$result2 = $myDB->query($query2);

$mylocation = "rma.php?page=form.php&new=yes";

print "\n";

print "window.location=\"".$mylocation."\";\n";

print "\n";

}

?>
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Re: Parsing CSV files into a MySQL Table

2004-11-02 Thread Eric McGrane
If what you have below is the exact SQL you have an error:

mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4, foo5, foo6,
foo7) VALUES '$foo1', '$foo2', '$foo3', '$foo4', '$foo5', '$foo6',
'$foo7')");

should be

mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4, foo5, foo6,
foo7) VALUES ('$foo1', '$foo2', '$foo3', '$foo4', '$foo5', '$foo6',
'$foo7')");

You are missing an opening paren after the VALUES keyword.  Using
mysql_error will help you catch these kinds of things.

E

"Mark Benson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi, newbie here, go easy on me I'm learning this as I go ;)
>
> Got a bit of teaser here.
>
> //
> mysql_connect (localhost, foouser, foologin);
>
> mysql_select_db (footest1);
>
> $csvfile = file("http://foo.com/foolist.csv";);
>
> foreach($csvfile as $line_no => $datastring) {
> $data = explode (",", $datastring);
> $foo1 = $data[0];
> $foo2 = $data[1];
> $foo3 = $data[2];
> $foo4 = $data[3];
> $foo5 = $data[4];
> $foo6 = $data[5];
> $foo7 = $data[6];
>
> mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4, foo5, foo6,
foo7)
> VALUES '$foo1', '$foo2', '$foo3', '$foo4', '$foo5', '$foo6', '$foo7')");
> }
>
> //?>
>
> The result of the above is I get nothing INSERT-ed in 'footable'. No lines
of data at all. I looked in the table using phpMyAdmin and zilch.
>
> I have however dumped the contents of each variable in the 'foreach' loop
to the screen in a table and it all maps out correctly as i was in the CSV
file, so the CSV file is being parsed correctly. The fault seems to be in
the MySQL query I think.
> Privilages have no influence - I've tried both the database's 'regular'
users and also the 'root' user and it makes no odds.
> I've also tried dumping the list of single variables and using '($data[0],
$data[1] etc...) and that has no effect.
>
> It's probably something glaringly obvious to an expert but as I say I'm
learning as I go so any help would be great :)
>
> Thx.
>
> -- 
> Mark Benson
>
> http://homepage.mac.com/markbenson

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Alex Bovey
>   mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, 
> foo4, foo5, foo6, foo7) 
>   VALUES '$foo1', '$foo2', '$foo3', '$foo4', 
> '$foo5', '$foo6', '$foo7')"); }

You're also missing an opening bracket after 'VALUES'.  The statement should
be:

mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4, foo5, foo6,
foo7) 
VALUES ('$foo1', '$foo2', '$foo3', '$foo4', '$foo5', '$foo6', '$foo7')");

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] MySQL data harvester

2004-11-02 Thread Perry, Matthew (Fire Marshal's Office)
My office purchased 21 fascinating cell phones that have GPS locaters and
bar codes.  

 

When we scan a bar code with one of these cell phones, the data is sent to a
third party company; information about this scan is stored on their
database.  

I have installed a "harvester" on my pc that downloads this data off of the
third party database into my own MySQL database.

I want to link this data with my other tables to modify my inventory
information.

 

What is the best way to continuously update all tables when new transactions
occur?  With MS SQL Server or ORACLE I would write a stored procedure or
trigger that could do this.  

What tools can I use with MySQL instead of procedures or triggers?

 

Matthew



Re: [PHP-DB] can i display an image _directly_ from postgres db storage?

2004-11-02 Thread Robby Russell
On Mon, 2004-11-01 at 21:36 -0600, P. George wrote:
> i know that postgres has a raw binary datatype called bytea for storing 
> pictures and whatnot, but i'm having trouble finding an example of 
> displaying an image on a web page with php that is pulled directly from 
> the database?
> 
> is this possible?

This example uses large objects, you can try to use the same logic and
use the bytea field.

http://blog.planetargon.com/index.php?/archives/27_Displaying_image_from_PostgreSQL_large_object_with_PHP.html


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Jason Wong
On Tuesday 02 November 2004 13:46, Mark Benson wrote:

> mysql_connect (localhost, foouser, foologin);

Always use check the return value of any mysql_*() function you use and make 
use of mysql_error().

> $csvfile = file("http://foo.com/foolist.csv";);

If you're using a newer version of PHP you can use fgetcsv() instead. Even 
better, if you're able to, use MySQL's LOAD DATA.

> foreach($csvfile as $line_no => $datastring) {

As you're not using $line_no the following is better:

  foreach ($csvfile as $datastring) {

>  mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4, foo5, foo6,
> foo7) VALUES '$foo1', '$foo2', '$foo3', '$foo4', '$foo5', '$foo6',
> '$foo7')"); }

Again, use mysql_error().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
 Michelle: You should be chief.
 Fry: What do I need, ulcers?
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Matt M.
> > $csvfile = file("http://foo.com/foolist.csv";);

and this 

fopen("http://foo.com/foolist.csv";, "r");

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Matt M.
> // 
> mysql_connect (localhost, foouser, foologin);
> 
> mysql_select_db (footest1);
> 
> $csvfile = file("http://foo.com/foolist.csv";);
> 
> foreach($csvfile as $line_no => $datastring) {
> $data = explode (",", $datastring);
> $foo1 = $data[0];
> $foo2 = $data[1];
> $foo3 = $data[2];
> $foo4 = $data[3];
> $foo5 = $data[4];
> $foo6 = $data[5];
> $foo7 = $data[6];
> 
> mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4, foo5, foo6, 
> foo7)
> VALUES '$foo1', '$foo2', '$foo3', '$foo4', '$foo5', '$foo6', 
> '$foo7')");
> }
> 
> //?>

try this

mysql_connect (localhost, foouser, foologin);

mysql_select_db (footest1);

$csvfile = file("http://foo.com/foolist.csv";);

while (($data = fgetcsv($csvfile, 1000, ",")) !== FALSE) {
   $foo1 = $data[0];
   $foo2 = $data[1];
   $foo3 = $data[2];
   $foo4 = $data[3];
   $foo5 = $data[4];
   $foo6 = $data[5];
   $foo7 = $data[6];

   mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4,
foo5, foo6, foo7)
   VALUES '$foo1', '$foo2', '$foo3', '$foo4', '$foo5',
'$foo6', '$foo7')");
}

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Mark Benson
Hi, newbie here, go easy on me I'm learning this as I go ;)

Got a bit of teaser here.

//http://foo.com/foolist.csv";);

foreach($csvfile as $line_no => $datastring) {
$data = explode (",", $datastring);
$foo1 = $data[0];
$foo2 = $data[1];
$foo3 = $data[2];
$foo4 = $data[3];
$foo5 = $data[4];
$foo6 = $data[5];
$foo7 = $data[6];

mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4, foo5, foo6, 
foo7) 
VALUES '$foo1', '$foo2', '$foo3', '$foo4', '$foo5', '$foo6', 
'$foo7')");
}

//?>

The result of the above is I get nothing INSERT-ed in 'footable'. No lines of data at 
all. I looked in the table using phpMyAdmin and zilch.

I have however dumped the contents of each variable in the 'foreach' loop to the 
screen in a table and it all maps out correctly as i was in the CSV file, so the CSV 
file is being parsed correctly. The fault seems to be in the MySQL query I think.
Privilages have no influence - I've tried both the database's 'regular' users and also 
the 'root' user and it makes no odds.
I've also tried dumping the list of single variables and using '($data[0], $data[1] 
etc...) and that has no effect.

It's probably something glaringly obvious to an expert but as I say I'm learning as I 
go so any help would be great :)

Thx.

-- 
Mark Benson

http://homepage.mac.com/markbenson

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Re: [EMAIL PROTECTED] November 2, 2004

2004-11-02 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 02 November 2004 08:04, GH wrote:

> Therefore everyone in the world has an interest in what happens in the
> american body politic just as Americans have an interest in what
> happens to the British Prime Minister and in parts of the British
> body politic. 

This may be true, and I will certainly be keeping an eye on the news to see
what the result of the presidential election is.

However, a substantial proportion of the people on this list do not have the
right to vote in this election, and are extremely irritated to receive a
reminder about voting on a list where such a reminder is wholly off-topic.
We would be equally irritated about a reminder to vote in
Canadian/Brazilian/Russian/South African elections (well, perhaps except for
those resident in those countries!).  I, personally, would be equally
irritated about a reminder to vote in British elections, even though it
would apply to me, since, again, it is wholly off-topic in this list.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: How do I reverse-finding root entry in tree-structure ?

2004-11-02 Thread David Robley
On Sun, 31 Oct 2004 13:10, -{ Rene Brehmer }- wrote:

> Hi gang
> 
> This is possibly insanely simple, but I've been coding on it for the past
> 11 hours, so my head's gone a little fuzzy.
> 
> been through the MySQL manual, but it's not really agreeing with me on
> finding anything useful...
> 
> I've got a table of categories, organised in a tree structure:
> 
> table wp_categories
> catID int(10) UNSIGNED
> parentID int(10) UNSIGNED
> rootID int(10) UNSIGNED
> level tinyint(3) UNSIGNED
> cat_title varchar(255)
> cat_desc text
> 
> catID being the primary key, parentID the parent's ID, and rootID the ID
> of the root category of the branch this category belongs to. Level is
> simply a number as to how deep in the tree the given category is. I only
> use it to make it simpler to build the graphics.
> 
> Here comes the problem: I need to be able to build visually the branch
> from root to a given folder, using only the given folder's ID as starting
> point. That is, traversing backwards up the branch from any given folder,
> and reattaching the branch till the root is reached.
> 
> Building the entire tree from root down is easy enough, but for some
> reason I've got a brainfart as to how I can go backwards.
> 
> That said, I know I could probably do this using recursive SQL statements,
> but I'd rather use as little talking with the DB as possible. The goal is
> to do this one task with as few SQL calls as entirely possible, preferably
> 1, 2 at most...  since I found building arrays and traversing them is much
> faster than SQL calls...
> 
> the root ID is 0, so any category in root, will have parentID of 0, and
> rootID of 0.
> 
> I figure using the rootID to just pull the relevant branch might be part
> of it, but my problem comes with reattaching the branch correctly, and
> finding the root folder and stick the branch to it ... and doing all of
> this in reverse since that's what I need for the visual part...
> 
> Using MySQL btw ...

I don't know if you have seen

http://www.sitepoint.com/print/hierarchical-data-database

but it may provide some help.

Cheers
-- 
David Robley

Don't use no double negatives.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] can i display an image _directly_ from postgres db storage?

2004-11-02 Thread Joshua D. Drake
Jason Wong wrote:
On Tuesday 02 November 2004 03:36, P. George wrote:
 

i know that postgres has a raw binary datatype called bytea for storing
pictures and whatnot, but i'm having trouble finding an example of
displaying an image on a web page with php that is pulled directly from
the database?
is this possible?
   

You probably don't want to use bytea as it will use a lot of
ram for larger images.
Instead you will want to look at large objects. The functions
you want are:
*pg_loreadall()* 	*pg_lo_read_all()* 

*pg_locreate()* 	*pg_lo_create()* 

*pg_lounlink()* 	*pg_lo_unlink()* 

*pg_loopen()* 	*pg_lo_open()* 

*pg_loclose()* 	*pg_lo_close()* 

*pg_loread()* 	*pg_lo_read()* 

*pg_lowrite()* 	*pg_lo_write()* 

*pg_loimport()* 	*pg_lo_import()* 

*pg_loexport()* 	*pg_lo_export()* 



Sincerely,
Joshua D. Drake

Yes.
 

if so, how?
   

Tutorials that shows how to upload and store image/binary files in a database 
also usually shows how to retrieve them (and in the case of images, also how 
to display them).

One function you'll find useful is
 imagecreatefromstring()
 


--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - [EMAIL PROTECTED] - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Re: November 2, 2004

2004-11-02 Thread rik onckelinx
Would you please stop bombing me with those unrelevant e-mails on a php 
mailinglist. It doesn't matter if I care about the US elections or not. 

I prefer to read your brilliant php code instead of politics.

With me many others on the list.

Rik

Op dinsdag 2 november 2004 10:25, schreef Michelle Konzack:
> Am 2004-11-02 03:06:35, schrieb GH:
> > and by the way the main reason we have problems  in America
> >
> >   * People with out health insurance
>
> This is every countries own problem...
> In Europe ALL People has a "health insurance".
>
> >   * No affordable housing
>
> Is this my problem ?
>
> >   * and a huge debt
>
> Do not play WAR with innocents.
>
> >   * amongst others
>
> Who ?
>
> > is because we give aid to almost any country who asks for it and
>
> Who ask for you ?  -  NOBODY.
>
> Americans are egoists and they are afraid they must play alone like
> a little children... America is fare from Europe and much more from
> Near East.
>
> > allow them to take the American's jobs...
>
> Rassist ?
>
> > Just a thought
>
> Greetings
> Michelle

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: [EMAIL PROTECTED] November 2, 2004

2004-11-02 Thread Stefan Reimers
To end up with this discussion:
It is a piece of truth that the whole world is curious on what will 
happen during ( ;-) )and after the voting in the US but as the main part 
of the world has no effect on the election by using php this posting was 
obviously misplaced. Worst of all, this posting started a discussion 
WHICH IS MISPLACED ITSELF IN THE PHP.DB LIST.

Gh wrote:
and by the way the main reason we have problems  in America 

  * People with out health insurance
[snip]
THAT is one of the major reasons the rest of the world gets p*d of
Americans ;)
--
Lester Caine
-
L.S.Caine Electronic Services

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Forms list from database

2004-11-02 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 01 November 2004 21:11, Jason T. Davidson wrote:

> Here is the code:
> 
> 
> cellspacing="0"> 
>  
>
>   
>   
>while ($check=mysql_fetch_array($result)){
> print "$check[LNAME],$check[FNAME]($check[CID])";
> }
> > 
>   
>
>  
>  

I think you're missing some  tags -- these should be
present around each value extracted from the database, so:

while ($check=mysql_fetch_array($result)){
print
"{$check['LNAME']},{$check['FNAME']}({$check['CID']})\n";
}
 

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: [EMAIL PROTECTED] November 2, 2004

2004-11-02 Thread Jason Wong
On Tuesday 02 November 2004 08:04, GH wrote:
> However, when other countries are in trouble or need something... who
> do they turn to? America

No country or government acts unless it is in their interests (perceived or 
otherwise) to do so. 

> Therefore everyone in the world has an interest in what happens in the
> american body politic just as Americans have an interest in what
> happens to the British Prime Minister and in parts of the British body
> politic.

It would be interesting if the rest of the world was able to partake in the 
American presidential elections. With the level of anti-"incumbent president" 
feelings around the world there'll soon be an ex-president.

It would be even more interesting to see what would happen if the upcoming 
Iraqi elections results in an anti-American pro-Islamist government. Would it 
then still be the "beacon of hope" that current administration keep 
espousing?

Now can we go back to discussing php and databases.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Fools ignore complexity.  Pragmatists suffer it.
Some can avoid it.  Geniuses remove it.
-- Perlis's Programming Proverb #58, SIGPLAN Notices, Sept.  1982
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Re: November 2, 2004

2004-11-02 Thread Michelle Konzack
Am 2004-11-02 03:06:35, schrieb GH:
> and by the way the main reason we have problems  in America 
> 
>   * People with out health insurance

This is every countries own problem...
In Europe ALL People has a "health insurance". 

>   * No affordable housing

Is this my problem ?

>   * and a huge debt  

Do not play WAR with innocents.

>   * amongst others

Who ?

> is because we give aid to almost any country who asks for it and

Who ask for you ?  -  NOBODY. 

Americans are egoists and they are afraid they must play alone like
a little children... America is fare from Europe and much more from
Near East.

> allow them to take the American's jobs...

Rassist ?

> Just a thought

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


RE: [PHP-DB] sms service to my site..?

2004-11-02 Thread Alex Bovey
> Dear Sir,
> I would like to add SMS Services in my Site. So if any body 
> know the scripts in PHP, Could you guide me to my progress..?.
> I think any body have done this kind of work as your company 
> projects..!, So i want urgent.
> Regd,
> Ilanthiraian,B

You need to use some kind of SMS gateway, such as www.clickatell.com.  You
can then get your PHP scripts to send SMSs by connecting to their gateway in
a variety of ways - e.g. SMTP, HTTP, FTP, email etc.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Re: November 2, 2004

2004-11-02 Thread Michelle Konzack
Am 2004-11-02 03:04:10, schrieb GH:
> However, when other countries are in trouble or need something... who
> do they turn to? America

Are you sure ?
Its only you American(s) which think so.

> Therefore everyone in the world has an interest in what happens in the
> american body politic just as Americans have an interest in what
> happens to the British Prime Minister and in parts of the British body
> politic.

But in FR/DE we p***s on you americans...

We do not like to play WARGAMES for Petrol and Profit !!!

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP-DB] Re: Re: November 2, 2004

2004-11-02 Thread Michelle Konzack
Am 2004-11-01 19:30:50, schrieb Joseph Crawford:
> > Do we care? Realy? Unlikely. Maybe you should send your 'useful' info on
> >   a national mailinglist only.
> 
> i am sorry but i do care, if you do not care about voting you dont
> care if the war comes to the US.

Maybe, but I am in France !!!

It is enough if I see every day in TV how many Iraqis-Children
(around 17.000 curently) are killed by American Commandos. 

Political stuff has nothing to do on this list !!!

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP-DB] Re: Re: November 2, 2004

2004-11-02 Thread Michelle Konzack
Am 2004-11-02 07:22:13, schrieb Lester Caine:

> There are many more of us who do not have the right to vote in the US, 
> just as we do not have the right to claim our 3.5% guaranteed mortgage. 
> Americans need to start thinking about OTHER countries rather than 
> assuming that they can just bombard every list with 'relevant' 
> information that is totally irrelevant to the rest of the world.
> 
> THAT is one of the major reasons the rest of the world gets p*d of 
> Americans ;)

Agreed.

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP-DB] Re: [EMAIL PROTECTED] November 2, 2004

2004-11-02 Thread GH
and by the way the main reason we have problems  in America 

  * People with out health insurance
  * No affordable housing
  * and a huge debt  
  * amongst others

is because we give aid to almost any country who asks for it and
allow them to take the American's jobs...

Just a thought


On Tue, 2 Nov 2004 03:04:10 -0500, GH <[EMAIL PROTECTED]> wrote:
> However, when other countries are in trouble or need something... who
> do they turn to? America
> 
> Therefore everyone in the world has an interest in what happens in the
> american body politic just as Americans have an interest in what
> happens to the British Prime Minister and in parts of the British body
> politic.
> 
> 
> 
> 
> On Tue, 02 Nov 2004 07:22:13 +, Lester Caine <[EMAIL PROTECTED]> wrote:
> > Joseph Crawford wrote:
> >
> > >>Do we care? Realy? Unlikely. Maybe you should send your 'useful' info on
> > >>  a national mailinglist only.
> > >
> > > i am sorry but i do care, if you do not care about voting you dont
> > > care if the war comes to the US.
> >
> > There are many more of us who do not have the right to vote in the US,
> > just as we do not have the right to claim our 3.5% guaranteed mortgage.
> > Americans need to start thinking about OTHER countries rather than
> > assuming that they can just bombard every list with 'relevant'
> > information that is totally irrelevant to the rest of the world.
> >
> > THAT is one of the major reasons the rest of the world gets p*d of
> > Americans ;)
> >
> > --
> > Lester Caine
> > -
> > L.S.Caine Electronic Services
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: [EMAIL PROTECTED] November 2, 2004

2004-11-02 Thread GH
However, when other countries are in trouble or need something... who
do they turn to? America

Therefore everyone in the world has an interest in what happens in the
american body politic just as Americans have an interest in what
happens to the British Prime Minister and in parts of the British body
politic.




On Tue, 02 Nov 2004 07:22:13 +, Lester Caine <[EMAIL PROTECTED]> wrote:
> Joseph Crawford wrote:
> 
> >>Do we care? Realy? Unlikely. Maybe you should send your 'useful' info on
> >>  a national mailinglist only.
> >
> > i am sorry but i do care, if you do not care about voting you dont
> > care if the war comes to the US.
> 
> There are many more of us who do not have the right to vote in the US,
> just as we do not have the right to claim our 3.5% guaranteed mortgage.
> Americans need to start thinking about OTHER countries rather than
> assuming that they can just bombard every list with 'relevant'
> information that is totally irrelevant to the rest of the world.
> 
> THAT is one of the major reasons the rest of the world gets p*d of
> Americans ;)
> 
> --
> Lester Caine
> -
> L.S.Caine Electronic Services
> 
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php