[PHP-DB] PHP and MYSQL Update problem

2010-01-26 Thread Simone Fornara
Hello,
I have a little problem with a sql command string

$q = UPDATE episodes SET episode_title = '$_POST[episode_title]' ,
episode_scheduleddate = .strtotime($_POST['episode_scheduleddate']).
, episode_description = '$_POST[episode_description]' WHERE episode_id
= $_POST[episode_id];

I keep getting this error

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 ''

which doesn't help a lot. I've already tried to print the result

UPDATE episodes SET episode_title = 'Title test 1 edited 2' ,
episode_scheduleddate = 1232427600 , episode_description =
'Description test edited' WHERE episode_id = 1

I really can't find the problem. I tried almost every combination with
' and  without any result.

Thank you.
Simon.

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



Re: [PHP-DB] PHP and MYSQL Update problem

2010-01-26 Thread Manu Gupta
try ..
$q = addslashes(UPDATE episodes SET episode_title = '$_POST[episode_title]'
,
episode_scheduleddate = .strtotime($_POST['episode_scheduleddate']).
, episode_description = '$_POST[episode_description]' WHERE episode_id
= $_POST[episode_id]);

or try

$q = UPDATE episodes SET episode_title = '{$_POST[episode_title]}' ,
episode_scheduleddate = {.strtotime($_POST['episode_scheduleddate'])}.
, episode_description = '{$_POST[episode_description]}' WHERE episode_id
= {$_POST[episode_id]};

On Tue, Jan 26, 2010 at 10:51 PM, Simone Fornara
simone.forn...@gmail.comwrote:

 Hello,
 I have a little problem with a sql command string

 $q = UPDATE episodes SET episode_title = '$_POST[episode_title]' ,
 episode_scheduleddate = .strtotime($_POST['episode_scheduleddate']).
 , episode_description = '$_POST[episode_description]' WHERE episode_id
 = $_POST[episode_id];

 I keep getting this error

 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 ''

 which doesn't help a lot. I've already tried to print the result

 UPDATE episodes SET episode_title = 'Title test 1 edited 2' ,
 episode_scheduleddate = 1232427600 , episode_description =
 'Description test edited' WHERE episode_id = 1

 I really can't find the problem. I tried almost every combination with
 ' and  without any result.

 Thank you.
 Simon.

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




-- 
Regards
MANU


Re: [PHP-DB] PHP and MYSQL Update problem

2010-01-26 Thread Chris

Manu Gupta wrote:

try ..
$q = addslashes(UPDATE episodes SET episode_title = '$_POST[episode_title]'
,
episode_scheduleddate = .strtotime($_POST['episode_scheduleddate']).
, episode_description = '$_POST[episode_description]' WHERE episode_id
= $_POST[episode_id]);

or try

$q = UPDATE episodes SET episode_title = '{$_POST[episode_title]}' ,
episode_scheduleddate = {.strtotime($_POST['episode_scheduleddate'])}.
, episode_description = '{$_POST[episode_description]}' WHERE episode_id
= {$_POST[episode_id]};


Good idea but you don't addslashes the whole query (and addslashes is 
the wrong thing to use).


Use mysql_real_escape_string around bits and pieces you want to escape:

$q = update episodes set episode_title=' . 
mysql_real_escape_string($_POST['episode_title']) . ', ..


--
Postgresql  php tutorials
http://www.designmagick.com/


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



[PHP-DB] php and mysql image script

2009-05-28 Thread Wilson Osemeilu
I need a simple php mysql image upload script with display script too and to 
make this easier the mysql database table to use
 


  

Re: [PHP-DB] php and mysql image script

2009-05-28 Thread Bastien Koert
On Thu, May 28, 2009 at 4:19 PM, Wilson Osemeilu engrwi...@yahoo.comwrote:

 I need a simple php mysql image upload script with display script too and
 to make this easier the mysql database table to use






STFW

-- 

Bastien

Cat, the other other white meat


Re: [PHP-DB] PHP and MySQL design question

2007-11-05 Thread Roberto Mansfield
Chris wrote:
 My point here was the if you index on (a, b), you don't need to index on
 (b, a) if both a and b are present in your where clause. The index is
 read from left to right -- not the where clause.
 
 Sure you do. Look at the OP's problem and you'll see you still do.
 
 To quote:
 
 As you can see that the user can select the columns in any arbitrary
 order and a query like: select name from benchmarks where logic =
 AUFLIA and status = sat returns result after sometime.
 
 I added another index like (logic, status) and the query returns
 result in blazing speed but then a query like:
 
 select name from benchmarks where status = sat and logic = AUFLIA
 
 takes more time to return the result as index were not created in that
 order.
 
 He has both fields included in the where and the index isn't used
 because it's defined in the opposite order.

I find the OP's results difficult to believe. There must be something
else going on besides the index. The mysql docs don't agree with this
behavior for version 3.x and up.

I also couldn't replicate this behavior in one of our tables on a 4.x
server with ~2 million rows. EXPLAIN indicated the same (a,b) index
would be used regardless of the order of the fields in the where clause.
Query times were equally fast as well.

-- 
Roberto Mansfield
Institutional Research and Application Development (IRAD)
SAS Computing

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



Re: [PHP-DB] PHP and MySQL design question

2007-11-04 Thread Chris

robertom wrote:

Chris wrote:

Roberto Mansfield wrote:

It shouldn't matter what order the columns are referenced. Mysql is
smart enough to optimize the query based on the available indexes.

In some cases yes but as with anything there are exceptions :)

mysql (and every other db) gets it wrong sometimes.


In fact, it should be good enough just to create an index on each column
that will be searched -- not on combinations of columns.

Multicolumn indexes definitely have their uses. But as the OP found out,
they are read left to right based on the idx definition.

http://dev.mysql.com/doc/refman/5.1/en/multiple-column-indexes.html
http://www.postgresql.org/docs/8.2/interactive/indexes-multicolumn.html

are two documents explaining this.


My point here was the if you index on (a, b), you don't need to index on
(b, a) if both a and b are present in your where clause. The index is
read from left to right -- not the where clause.


Sure you do. Look at the OP's problem and you'll see you still do.

To quote:

As you can see that the user can select the columns in any arbitrary
order and a query like: select name from benchmarks where logic =
AUFLIA and status = sat returns result after sometime.

I added another index like (logic, status) and the query returns
result in blazing speed but then a query like:

select name from benchmarks where status = sat and logic = AUFLIA

takes more time to return the result as index were not created in that 
order.



He has both fields included in the where and the index isn't used 
because it's defined in the opposite order.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] PHP and MySQL design question

2007-11-02 Thread Chris

Roberto Mansfield wrote:

It shouldn't matter what order the columns are referenced. Mysql is
smart enough to optimize the query based on the available indexes.


In some cases yes but as with anything there are exceptions :)

mysql (and every other db) gets it wrong sometimes.


In fact, it should be good enough just to create an index on each column
that will be searched -- not on combinations of columns.


Multicolumn indexes definitely have their uses. But as the OP found out, 
they are read left to right based on the idx definition.


http://dev.mysql.com/doc/refman/5.1/en/multiple-column-indexes.html
http://www.postgresql.org/docs/8.2/interactive/indexes-multicolumn.html

are two documents explaining this.


Do you have any performance numbers to believe that this is not the case?


Mysql will actually only use one index per table. I was surprised to 
find this out but it's mentioned in 
http://www.amazon.com/High-Performance-MySQL-Jeremy-Zawodny/dp/0596003064/ 
- page 64 (just looked it up to include a page ref).


No idea if this is mentioned anywhere on the mysql site (doubt it).

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] PHP and MySQL design question

2007-11-02 Thread Roberto Mansfield
 Chris wrote:
 Mysql will actually only use one index per table. I was surprised to
 find this out but it's mentioned in
 http://www.amazon.com/High-Performance-MySQL-Jeremy-Zawodny/dp/0596003064/
 - page 64 (just looked it up to include a page ref).

 No idea if this is mentioned anywhere on the mysql site (doubt it).

A friend at Mysql just sent me this. It is the portion of the mysql docs
which discusses the new index optimization in 5.x and later.

http://dev.mysql.com/doc/refman/5.0/en/index-merge-optimization.html

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



Re: [PHP-DB] PHP and MySQL design question

2007-11-02 Thread robertom
Chris wrote:
 Roberto Mansfield wrote:
 It shouldn't matter what order the columns are referenced. Mysql is
 smart enough to optimize the query based on the available indexes.
 
 In some cases yes but as with anything there are exceptions :)
 
 mysql (and every other db) gets it wrong sometimes.
 
 In fact, it should be good enough just to create an index on each column
 that will be searched -- not on combinations of columns.
 
 Multicolumn indexes definitely have their uses. But as the OP found out,
 they are read left to right based on the idx definition.
 
 http://dev.mysql.com/doc/refman/5.1/en/multiple-column-indexes.html
 http://www.postgresql.org/docs/8.2/interactive/indexes-multicolumn.html
 
 are two documents explaining this.

My point here was the if you index on (a, b), you don't need to index on
(b, a) if both a and b are present in your where clause. The index is
read from left to right -- not the where clause.


 Do you have any performance numbers to believe that this is not the case?
 
 Mysql will actually only use one index per table. I was surprised to
 find this out but it's mentioned in
 http://www.amazon.com/High-Performance-MySQL-Jeremy-Zawodny/dp/0596003064/
 - page 64 (just looked it up to include a page ref).
 
 No idea if this is mentioned anywhere on the mysql site (doubt it).

This is the case in 4.x and earlier. In 5.x and later, mysql can use
multiple indexes per table in a query.

You can verify this with EXPLAIN assuming the optimizer considers using
multiple indexes to be fastest. (Sometimes, one restriction will limit
the result considerably and using multiple indexes isn't necessary.)

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



Re: [PHP-DB] PHP and MySQL design question

2007-10-24 Thread Roberto Mansfield
It shouldn't matter what order the columns are referenced. Mysql is
smart enough to optimize the query based on the available indexes. In
fact, it should be good enough just to create an index on each column
that will be searched -- not on combinations of columns. Do you have any
performance numbers to believe that this is not the case?

Roberto


Byte Smokers wrote:
 Hello
 
 I did look into the info from EXPLAIN. I can create the indexes also but
 then I have to create indexes with all permutation of column order if I want
 to get good performance from all search query regardless of what order user
 enters the column.
 
 On 10/23/07, Theodoros Goltsios [EMAIL PROTECTED] wrote:
 I guess EXPLAIN will do the job for you. First of all in order to ensure
 what is the index used by your queries and then how to improve
 performance by making the right indexes.

 Theodoros Goltsios
 Kinetix Tele.com Support Center
 email: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Tel.  Fax: +30 2310556134
 WWW: http://www.kinetix.gr/



 O/H Byte Smokers ??:
 Hello all

 I have a table like:

 CREATE TABLE `benchmarks` (
   `name` varchar(50) NOT NULL default '',
   `logic` varchar(50) NOT NULL default '',
   `status` varchar(50) NOT NULL default '',
   `difficulty` int(11) NOT NULL default '0',
   `xmldata` longblob,
   PRIMARY KEY  (`name`),
   KEY `logic` (`logic`),
   KEY `status` (`status`),
   KEY `difficulty` (`difficulty`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1

 I have a search form like: http://craig.cs.uiowa.edu/smt/index.php
 where each field corresponds to each field in the table.

 Now user can select any column arbitrality and I generate the select
 statement depending upon that by looping through each listbox.

 As you can see that the user can select the columns in any arbitrary
 order and a query like: select name from benchmarks where logic =
 AUFLIA and status = sat returns result after sometime.

 I added another index like (logic, status) and the query returns
 result in blazing speed but then a query like:

 select name from benchmarks where status = sat and logic = AUFLIA

 takes more time to return the result as index were not created in that
 order.
 I can get all the possible combination by having indexes like:

 abc bc c ac (where a,b,c are columns) but it dosnt scale well. If
 later on I decide to add another column, I have to add all permutation
 in the indexes too.

 How can I solve this problem?

 Thank you.

 Ritesh


 

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



Re: [PHP-DB] PHP and MySQL design question

2007-10-23 Thread Theodoros Goltsios
I guess EXPLAIN will do the job for you. First of all in order to ensure 
what is the index used by your queries and then how to improve 
performance by making the right indexes.


Theodoros Goltsios
Kinetix Tele.com Support Center
email: [EMAIL PROTECTED], [EMAIL PROTECTED]
Tel.  Fax: +30 2310556134
WWW: http://www.kinetix.gr/



O/H Byte Smokers ??:

Hello all

I have a table like:

CREATE TABLE `benchmarks` (
  `name` varchar(50) NOT NULL default '',
  `logic` varchar(50) NOT NULL default '',
  `status` varchar(50) NOT NULL default '',
  `difficulty` int(11) NOT NULL default '0',
  `xmldata` longblob,
  PRIMARY KEY  (`name`),
  KEY `logic` (`logic`),
  KEY `status` (`status`),
  KEY `difficulty` (`difficulty`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

I have a search form like: http://craig.cs.uiowa.edu/smt/index.php
where each field corresponds to each field in the table.

Now user can select any column arbitrality and I generate the select
statement depending upon that by looping through each listbox.

As you can see that the user can select the columns in any arbitrary
order and a query like: select name from benchmarks where logic =
AUFLIA and status = sat returns result after sometime.

I added another index like (logic, status) and the query returns
result in blazing speed but then a query like:

select name from benchmarks where status = sat and logic = AUFLIA

takes more time to return the result as index were not created in that order.

I can get all the possible combination by having indexes like:

abc bc c ac (where a,b,c are columns) but it dosnt scale well. If
later on I decide to add another column, I have to add all permutation
in the indexes too.

How can I solve this problem?

Thank you.

Ritesh

  


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



Re: [PHP-DB] PHP and MySQL design question

2007-10-23 Thread Byte Smokers
Hello

I did look into the info from EXPLAIN. I can create the indexes also but
then I have to create indexes with all permutation of column order if I want
to get good performance from all search query regardless of what order user
enters the column.

On 10/23/07, Theodoros Goltsios [EMAIL PROTECTED] wrote:

 I guess EXPLAIN will do the job for you. First of all in order to ensure
 what is the index used by your queries and then how to improve
 performance by making the right indexes.

 Theodoros Goltsios
 Kinetix Tele.com Support Center
 email: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Tel.  Fax: +30 2310556134
 WWW: http://www.kinetix.gr/



 O/H Byte Smokers ??:
  Hello all
 
  I have a table like:
 
  CREATE TABLE `benchmarks` (
`name` varchar(50) NOT NULL default '',
`logic` varchar(50) NOT NULL default '',
`status` varchar(50) NOT NULL default '',
`difficulty` int(11) NOT NULL default '0',
`xmldata` longblob,
PRIMARY KEY  (`name`),
KEY `logic` (`logic`),
KEY `status` (`status`),
KEY `difficulty` (`difficulty`)
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
  I have a search form like: http://craig.cs.uiowa.edu/smt/index.php
  where each field corresponds to each field in the table.
 
  Now user can select any column arbitrality and I generate the select
  statement depending upon that by looping through each listbox.
 
  As you can see that the user can select the columns in any arbitrary
  order and a query like: select name from benchmarks where logic =
  AUFLIA and status = sat returns result after sometime.
 
  I added another index like (logic, status) and the query returns
  result in blazing speed but then a query like:
 
  select name from benchmarks where status = sat and logic = AUFLIA
 
  takes more time to return the result as index were not created in that
 order.
 
  I can get all the possible combination by having indexes like:
 
  abc bc c ac (where a,b,c are columns) but it dosnt scale well. If
  later on I decide to add another column, I have to add all permutation
  in the indexes too.
 
  How can I solve this problem?
 
  Thank you.
 
  Ritesh
 
 



Re: [PHP-DB] PHP and MYSQL

2007-05-27 Thread Chris

Na Derro Cartwright wrote:
I am trying to simply display all the values from a simple query but I 
am recieveing an error that I have to upgrade my client.  I am not sure 
what that means.


Put the full message in to your preferred search engine - I know the 
message you mean and I'm sure one of the top 3 links will tell you the 
problem.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] PHP and MYSQL

2007-05-26 Thread Na Derro Cartwright

Chris wrote:

Na Derro Cartwright wrote:
I am currently running php4 with mysql 5.  when I try to run a query 
using the mysql command I recieve and error that reads the resource 
id and a number.  What does that mean?


Firstly always cc the list - others will be able to provide their 
input and others will also learn from the problem/resolution.


What is the query? What is the error?

If you run it manually through command line mysql or phpmyadmin do you 
get an error?


When I run the command from the command line I am able to connect to the 
server on my local host but when I attempt to run it through PHP i get 
an error message that tells me I have to upgrade my client.  I am not 
really sure what that means.  Can someone offer assistance?


C

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



Re: [PHP-DB] PHP and MYSQL

2007-05-26 Thread Na Derro Cartwright
I am trying to simply display all the values from a simple query but I 
am recieveing an error that I have to upgrade my client.  I am not sure 
what that means.


Chris wrote:

Na Derro Cartwright wrote:
I am currently running php4 with mysql 5.  when I try to run a query 
using the mysql command I recieve and error that reads the resource 
id and a number.  What does that mean?


Firstly always cc the list - others will be able to provide their 
input and others will also learn from the problem/resolution.


What is the query? What is the error?

If you run it manually through command line mysql or phpmyadmin do you 
get an error?




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



Re: [PHP-DB] PHP and MYSQL

2007-05-02 Thread James Gadrow

Chris wrote:

Na Derro Cartwright wrote:
I am currently running php4 with mysql 5.  when I try to run a query 
using the mysql command I recieve and error that reads the resource 
id and a number.  What does that mean?


Firstly always cc the list - others will be able to provide their 
input and others will also learn from the problem/resolution.


What is the query? What is the error?

If you run it manually through command line mysql or phpmyadmin do you 
get an error?



You're probably doing something like:

//Open connection and database
$handle = mysql_connect($host, $user, $pass);
mysql_select_db($database);
//Run query
$result = mysql_query(SELECT foo FROM bar);
//Close connection
mysql_close($handle);
//Show result
echo $result;

The correct way to do this is:
//Open connection and database
$handle = mysql_connect($host, $user, $pass);
mysql_select_db($database);
//Run query
$result = mysql_query(SELECT foo FROM bar);
//use resource id returned from query to fetch actual results (note that 
the 0 is a line number so in the case you have more than 1 result you'll 
have to use a different method such as mysql_fetch_assoc or something 
I'd advise you take a look at the documentation @ php.net)

$result = mysql_result($result, 0);
//Close connection
mysql_close($handle);
//Show result
echo $result;

--
Thanks,

Jim

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



[PHP-DB] PHP and MYSQL

2007-05-01 Thread Na Derro Cartwright
Can PHP 4 work with MYSQL 5?


Re: [PHP-DB] PHP and MYSQL

2007-05-01 Thread Chris

Na Derro Cartwright wrote:

Can PHP 4 work with MYSQL 5?


Yep.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] PHP and MySQL on Windows causing severe slowdown

2006-09-10 Thread Chris

Diane wrote:
 I just switched a customer from one Windows host to another. The new 
host is a Windows only shop, and not overly familiar with MySQL and PHP. 
My customer has two PHP applications, both important to the site. 
Everything else is ASP or ASP.NET.


When the new host installed PHP and MySQL, the website slowed down to a 
crawl. Troubleshooting identified the PHP module that connects to MySQL 
to be the problem. Remove the DLL and there is no problem. Restore the 
DLL and the problem returns. Neither PHP app is as yet installed, but we 
are still getting these problems. Needless to say, we need to access the 
databases!


The Windows server is OS: Windows Server 2003 Web Edition
Memory: 320 MB RAM
Disk: 15 GB SATA Raptor 10K RPM (Free Upgrade!)
Allotted Bandwidth: 100 GB Bandwidth

MySQL 4 was installed, but was replaced with MySQL 5, hoping this would 
solve the problem. It didn't. The PHP version is 5.1


Did you update the php_mysql.dll and associated files as well? The 
php_mysql.dll for mysql 4 will be different to the one for mysql 5.


What shows in the logs?

--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP-DB] PHP and MySQL on Windows causing severe slowdown

2006-09-08 Thread Diane
 I just switched a customer from one Windows host to another. The new 
host is a Windows only shop, and not overly familiar with MySQL and PHP. 
My customer has two PHP applications, both important to the site. 
Everything else is ASP or ASP.NET.


When the new host installed PHP and MySQL, the website slowed down to a 
crawl. Troubleshooting identified the PHP module that connects to MySQL 
to be the problem. Remove the DLL and there is no problem. Restore the 
DLL and the problem returns. Neither PHP app is as yet installed, but we 
are still getting these problems. Needless to say, we need to access the 
databases!


The Windows server is OS: Windows Server 2003 Web Edition
Memory: 320 MB RAM
Disk: 15 GB SATA Raptor 10K RPM (Free Upgrade!)
Allotted Bandwidth: 100 GB Bandwidth

MySQL 4 was installed, but was replaced with MySQL 5, hoping this would 
solve the problem. It didn't. The PHP version is 5.1


Any and all help with this problem would be very much appreciated!

Diane

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



RE: [PHP-DB] Php with MySQL replication

2005-08-16 Thread Bastien Koert
Have you made any progess with this yet? Could it simply be a delay due to 
replication log size before the replication is triggered...its much more a 
mysql issue than a php one...


Bastien



From: David Brinks [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Php with MySQL replication
Date: Fri, 5 Aug 2005 17:20:22 -0400

I seem to be having a problem when using php with a replicated database and
the replicated database not being updated correctly.  I have verified that
replication in general works.  When transactions are entered through either
a perl script or through console, the replicated client receives the 
updates

almost instantly.  When a transaction goes through php, on the other hand,
the master database will be updated but the master does not seem to send 
the

update to the replicated client.

Mysql version are both 4.0.18.
Mod_php4-4.3.7 is the php code.

Sample from php script...

$conn = mysql_connect($Server, $User, $Pass);
$sql = INSERT INTO test.database VALUE ('','hello');
$result = mysql_query($sql,$conn);
$closed = Mysql_close($conn);

If anyone has any suggestions, I would appreciate it.

Thanks.

David Brinks --- Power-Net Internet Services
[EMAIL PROTECTED]
Local Office : 402 N. Mission, Mount Pleasant, MI 48858

--
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] Php with MySQL replication

2005-08-05 Thread David Brinks
I seem to be having a problem when using php with a replicated database and
the replicated database not being updated correctly.  I have verified that
replication in general works.  When transactions are entered through either
a perl script or through console, the replicated client receives the updates
almost instantly.  When a transaction goes through php, on the other hand,
the master database will be updated but the master does not seem to send the
update to the replicated client.

Mysql version are both 4.0.18.
Mod_php4-4.3.7 is the php code.

Sample from php script...

$conn = mysql_connect($Server, $User, $Pass);
$sql = INSERT INTO test.database VALUE ('','hello');
$result = mysql_query($sql,$conn);
$closed = Mysql_close($conn);

If anyone has any suggestions, I would appreciate it.

Thanks.

David Brinks --- Power-Net Internet Services
[EMAIL PROTECTED]
Local Office : 402 N. Mission, Mount Pleasant, MI 48858

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



[PHP-DB] PHP and Mysql help

2005-04-24 Thread ReClMaples
Can someone help me out with an issue I'm having?



Here is my code:

$res = mysql_query(SELECT ZG_LATITUDE, ZG_LONGITUDE FROM zip_code
wherezg_zipcode = '$zip');

List($Lat,$Lon) = mysql_fetch_row($res);

$Lat1 = ($Lat-2);

$Lat2= ($Lat+2);

$Lon1= ($Lon-2);

$Lon2= ($Lon+2);

//echo ($Lat1);

//echo ($Lat2);

//echo ($Lon1);

//echo ($Lon2);

$zipcode = mysql_query(

SELECT * FROM zip_code where ZG_LATITUDE = $Lat1

and ZG_LATITUDE = $Lat2 and ZG_LONGITUDE = $Lon1 and ZG_LONGITUDE =

$Lon2);

if (!$zipcode) {

echo(PError performing query:  .

mysql_error() . /P);

exit();

}



while ( $row = mysql_fetch_array($zipcode) )

{

echo(bCity: /b . $row[ZG_CITY]. br);

echo(bState: /b . $row[ZG_STATE]. br);

echo(bZip Code: /b . $row[ZG_ZIPCODE]. br);

echo(bArea Code: /b . $row[ZG_AREACODE]. br);

echo(bCounty FIPS: /b . $row[ZG_COUNTY_FIPS]. br);

echo(bCounty Name: /b . $row[ZG_COUNTY_NAME]. br);

echo(bTime Zone: /b . $row[ZG_TIME_ZONE]. br);

echo(bDay Light Savings?: /b . $row[ZG_DST]. br);

echo(bLatitude: /b . $row[ZG_LATITUDE]. br);

echo(bLongitude: /b . $row[ZG_LONGITUDE]. P);

}

I get no results with this still, it acutally doesn't even go to the this

page. When I uncomment out:

//echo ($Lat1);

//echo ($Lat2);

//echo ($Lon1);

//echo ($Lon2);

and comment out everything below this, I get the expected results for

$Lat1,$Lat2,$Lon1, and $Lon2. So I have to believe my issue is below those

lines, can anyone see what I have that is incorrect here?



Re: [PHP-DB] PHP and Mysql help

2005-04-24 Thread Colin Busby
Hey,
That is a lot of code, so I only skimmed it, but right off the bat i  
noticed that you are missing a space in between WHERE and zg_zipcode,  
as shown below:

$res = mysql_query(SELECT ZG_LATITUDE, ZG_LONGITUDE FROM zip_code
wherezg_zipcode = '$zip');
should be:
$res = mysql_query(SELECT ZG_LATITUDE, ZG_LONGITUDE FROM zip_code
WHERE zg_zipcode = '$zip');
I hope this helps...
- Colin Busby
---
Colin Busby
Sackville, NB Canada
http://www.colinbusby.ca
On 24-Apr-05, at 7:54 PM, ReClMaples wrote:
Can someone help me out with an issue I'm having?

Here is my code:
$res = mysql_query(SELECT ZG_LATITUDE, ZG_LONGITUDE FROM zip_code
wherezg_zipcode = '$zip');
List($Lat,$Lon) = mysql_fetch_row($res);
$Lat1 = ($Lat-2);
$Lat2= ($Lat+2);
$Lon1= ($Lon-2);
$Lon2= ($Lon+2);
//echo ($Lat1);
//echo ($Lat2);
//echo ($Lon1);
//echo ($Lon2);
$zipcode = mysql_query(
SELECT * FROM zip_code where ZG_LATITUDE = $Lat1
and ZG_LATITUDE = $Lat2 and ZG_LONGITUDE = $Lon1 and ZG_LONGITUDE =
$Lon2);
if (!$zipcode) {
echo(PError performing query:  .
mysql_error() . /P);
exit();
}

while ( $row = mysql_fetch_array($zipcode) )
{
echo(bCity: /b . $row[ZG_CITY]. br);
echo(bState: /b . $row[ZG_STATE]. br);
echo(bZip Code: /b . $row[ZG_ZIPCODE]. br);
echo(bArea Code: /b . $row[ZG_AREACODE]. br);
echo(bCounty FIPS: /b . $row[ZG_COUNTY_FIPS]. br);
echo(bCounty Name: /b . $row[ZG_COUNTY_NAME]. br);
echo(bTime Zone: /b . $row[ZG_TIME_ZONE]. br);
echo(bDay Light Savings?: /b . $row[ZG_DST]. br);
echo(bLatitude: /b . $row[ZG_LATITUDE]. br);
echo(bLongitude: /b . $row[ZG_LONGITUDE]. P);
}
I get no results with this still, it acutally doesn't even go to  
the this

page. When I uncomment out:
//echo ($Lat1);
//echo ($Lat2);
//echo ($Lon1);
//echo ($Lon2);
and comment out everything below this, I get the expected results for
$Lat1,$Lat2,$Lon1, and $Lon2. So I have to believe my issue is  
below those

lines, can anyone see what I have that is incorrect here?




Re: [PHP-DB] PHP and Mysql help

2005-04-24 Thread Amos Glenn
ReClMaples wrote:
$zipcode = mysql_query(
SELECT * FROM zip_code where ZG_LATITUDE = $Lat1
and ZG_LATITUDE = $Lat2 and ZG_LONGITUDE = $Lon1 and ZG_LONGITUDE =
$Lon2);
Try putting single quotes around the variables in your query string; 
mysql sees them as strings, not variables:

... ZG_LATITUDE = '$Lat1' and ZG_LATITUDE = '$Lat2' ...
-Amos
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


SV: [PHP-DB] PHP and MySql question

2005-04-18 Thread Henrik Hornemann
Hi,

Your problem is that your variables $Lat1,$Lat2,$Lon1,$Lon2 all reffer
to resultsets and not the Latitudes or Longitudes.
Try something like this: 

$res = mysql_query(
SELECT ZG_LATITUDE, ZG-LONGITUDE FROM zip_code where
zg_zipcode = '$zip');
List($Lat,$Lon) = mysql_fetch_row($res);
$Lat1=Lat-2; $Lat2=Lat+2; $Lon1=Lon-2; $Lon2=Lat+2;

Now you can use the values in your final query. 

Hth Henrik Hornemann 

-Oprindelig meddelelse-
Fra: ReClMaples [mailto:[EMAIL PROTECTED] 
Sendt: 16. april 2005 22:38
Til: php-db@lists.php.net
Emne: [PHP-DB] PHP and MySql question

Hello, I'm kinda new at PHP programming with MySQL.  I am having an
issue and am not sure if this is the corret way to do this:  Here is my
code, I'll start there:

?php

  $Lat1 = mysql_query(
SELECT (ZG_LATITUDE-2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lat1) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$Lat2 = mysql_query(
SELECT (ZG_LATITUDE+2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lat2) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$Lon1 = mysql_query(
SELECT (ZG_LONGITUDE-2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lon1) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$Lon2 = mysql_query(
SELECT (ZG_LONGITUDE+2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lon2) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$ZipCode = mysql_query(
SELECT * FROM zip_code where ZG_LATITUDE = '$Lat1'
and ZG_LATITUDE = '$Lat2' and ZG_LONGITUDE = '$Lon1' and ZG_LONGITUDE
= '$Lon2');
  if (!$Zipcodesearch) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

  while ( $row = mysql_fetch_array($ZipCode) ) {
echo(bCity: /b . $row[ZG_CITY]. br);
echo(bState: /b . $row[ZG_STATE]. br); echo(bZip Code:
/b . $row[ZG_ZIPCODE]. br); echo(bArea Code: /b .
$row[ZG_AREACODE]. br); echo(bCounty FIPS: /b .
$row[ZG_COUNTY_FIPS]. br); echo(bCounty Name: /b .
$row[ZG_COUNTY_NAME]. br); echo(bTime Zone: /b .
$row[ZG_TIME_ZONE]. br); echo(bDay Light Savings?: /b .
$row[ZG_DST]. br);
echo(bLatitude: /b . $row[ZG_LATITUDE]. br);
echo(bLongitude: /b . $row[ZG_LONGITUDE]. P); } ?

Basically I'm trying to have a user input a zip code and then have a php
script pull all zip codes that are in a region of that submitted zip
code.
Can you have a look at my code and see what I'm doing wrong?  When using
this it returns no results but makes the connection to the database so I
have to believe that it's within here that I have my issue.

I have Apache/2.0.47 (Win32) PHP/4.3.9 Server and MySql 4.0.14 (I know I
can upgrade and be able to do subselects but I would like to know what
I'm doing wrong here.

Thanks in advance for any help.

Thanks
-rich

--
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] PHP and MySql question

2005-04-18 Thread ReClMaples
Ok, I tried what you saidHere's the code:

$res = mysql_query(
SELECT ZG_LATITUDE, ZG_LONGITUDE FROM zip_code where
zg_zipcode = '$zip');
List($Lat,$Lon) = mysql_fetch_row($res);
$Lat1 = ($Lat-2);
$Lat2= ($Lat+2);
$Lon1= ($Lon-2);
$Lon2= ($Lon+2);

//echo ($Lat1);
//echo ($Lat2);
//echo ($Lon1);
//echo ($Lon2);

$zipcode = mysql_query(
  SELECT * FROM zip_code where ZG_LATITUDE = $Lat1
and ZG_LATITUDE = $Lat2 and ZG_LONGITUDE = $Lon1 and ZG_LONGITUDE =
$Lon2);
if (!$zipcode) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
}


while ( $row = mysql_fetch_array($zipcode) )
{
echo(bCity: /b . $row[ZG_CITY]. br);
echo(bState: /b . $row[ZG_STATE]. br);
echo(bZip Code: /b . $row[ZG_ZIPCODE]. br);
echo(bArea Code: /b . $row[ZG_AREACODE]. br);
echo(bCounty FIPS: /b . $row[ZG_COUNTY_FIPS]. br);
echo(bCounty Name: /b . $row[ZG_COUNTY_NAME]. br);
echo(bTime Zone: /b . $row[ZG_TIME_ZONE]. br);
echo(bDay Light Savings?: /b . $row[ZG_DST]. br);
echo(bLatitude: /b . $row[ZG_LATITUDE]. br);
echo(bLongitude: /b . $row[ZG_LONGITUDE]. P);

}

I get no results with this still, it acutally doesn't even go to the this
page.  When I uncomment out:

//echo ($Lat1);
//echo ($Lat2);
//echo ($Lon1);
//echo ($Lon2);

and comment out everything below this, I get the expected results for
$Lat1,$Lat2,$Lon1, and $Lon2.  So I have to believe my issue is below those
lines, can anyone see what I have that is incorrect here?

-Original Message-
From: Henrik Hornemann [mailto:[EMAIL PROTECTED]
Sent: Monday, April 18, 2005 2:44 AM
To: php-db@lists.php.net
Subject: SV: [PHP-DB] PHP and MySql question


Hi,

Your problem is that your variables $Lat1,$Lat2,$Lon1,$Lon2 all reffer
to resultsets and not the Latitudes or Longitudes.
Try something like this:

$res = mysql_query(
SELECT ZG_LATITUDE, ZG-LONGITUDE FROM zip_code where
zg_zipcode = '$zip');
List($Lat,$Lon) = mysql_fetch_row($res);
$Lat1=Lat-2; $Lat2=Lat+2; $Lon1=Lon-2; $Lon2=Lat+2;

Now you can use the values in your final query.

Hth Henrik Hornemann

-Oprindelig meddelelse-
Fra: ReClMaples [mailto:[EMAIL PROTECTED]
Sendt: 16. april 2005 22:38
Til: php-db@lists.php.net
Emne: [PHP-DB] PHP and MySql question

Hello, I'm kinda new at PHP programming with MySQL.  I am having an
issue and am not sure if this is the corret way to do this:  Here is my
code, I'll start there:

?php

  $Lat1 = mysql_query(
SELECT (ZG_LATITUDE-2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lat1) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$Lat2 = mysql_query(
SELECT (ZG_LATITUDE+2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lat2) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$Lon1 = mysql_query(
SELECT (ZG_LONGITUDE-2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lon1) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$Lon2 = mysql_query(
SELECT (ZG_LONGITUDE+2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lon2) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$ZipCode = mysql_query(
SELECT * FROM zip_code where ZG_LATITUDE = '$Lat1'
and ZG_LATITUDE = '$Lat2' and ZG_LONGITUDE = '$Lon1' and ZG_LONGITUDE
= '$Lon2');
  if (!$Zipcodesearch) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

  while ( $row = mysql_fetch_array($ZipCode) ) {
echo(bCity: /b . $row[ZG_CITY]. br);
echo(bState: /b . $row[ZG_STATE]. br); echo(bZip Code:
/b . $row[ZG_ZIPCODE]. br); echo(bArea Code: /b .
$row[ZG_AREACODE]. br); echo(bCounty FIPS: /b .
$row[ZG_COUNTY_FIPS]. br); echo(bCounty Name: /b .
$row[ZG_COUNTY_NAME]. br); echo(bTime Zone: /b .
$row[ZG_TIME_ZONE]. br); echo(bDay Light Savings?: /b .
$row[ZG_DST]. br);
echo(bLatitude: /b . $row[ZG_LATITUDE]. br);
echo(bLongitude: /b . $row[ZG_LONGITUDE]. P); } ?

Basically I'm trying to have a user input a zip code and then have a php
script pull all zip codes that are in a region of that submitted zip
code.
Can you have a look at my code and see what I'm doing wrong?  When using
this it returns no results but makes the connection to the database so I
have to believe that it's within here that I have my issue.

I have Apache/2.0.47 (Win32) PHP/4.3.9 Server and MySql 4.0.14 (I know I
can upgrade and be able to do subselects but I would like to know what
I'm doing wrong here.

Thanks in advance for any help.

Thanks
-rich

--
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PHP and MySql question

2005-04-16 Thread ReClMaples
Hello, I'm kinda new at PHP programming with MySQL.  I am having an issue
and am not sure if this is the corret way to do this:  Here is my code, I'll
start there:

?php

  $Lat1 = mysql_query(
SELECT (ZG_LATITUDE-2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lat1) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$Lat2 = mysql_query(
SELECT (ZG_LATITUDE+2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lat2) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$Lon1 = mysql_query(
SELECT (ZG_LONGITUDE-2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lon1) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$Lon2 = mysql_query(
SELECT (ZG_LONGITUDE+2) FROM zip_code where zg_zipcode =
'$zip');
  if (!$Lon2) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

$ZipCode = mysql_query(
SELECT * FROM zip_code where ZG_LATITUDE = '$Lat1'
and ZG_LATITUDE = '$Lat2' and ZG_LONGITUDE = '$Lon1' and ZG_LONGITUDE =
'$Lon2');
  if (!$Zipcodesearch) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

  while ( $row = mysql_fetch_array($ZipCode) ) {
echo(bCity: /b . $row[ZG_CITY]. br);
echo(bState: /b . $row[ZG_STATE]. br);
echo(bZip Code: /b . $row[ZG_ZIPCODE]. br);
echo(bArea Code: /b . $row[ZG_AREACODE]. br);
echo(bCounty FIPS: /b . $row[ZG_COUNTY_FIPS]. br);
echo(bCounty Name: /b . $row[ZG_COUNTY_NAME]. br);
echo(bTime Zone: /b . $row[ZG_TIME_ZONE]. br);
echo(bDay Light Savings?: /b . $row[ZG_DST]. br);
echo(bLatitude: /b . $row[ZG_LATITUDE]. br);
echo(bLongitude: /b . $row[ZG_LONGITUDE]. P);
}
?

Basically I'm trying to have a user input a zip code and then have a php
script pull all zip codes that are in a region of that submitted zip code.
Can you have a look at my code and see what I'm doing wrong?  When using
this it returns no results but makes the connection to the database so I
have to believe that it's within here that I have my issue.

I have Apache/2.0.47 (Win32) PHP/4.3.9 Server and MySql 4.0.14 (I know I can
upgrade and be able to do subselects but I would like to know what I'm doing
wrong here.

Thanks in advance for any help.

Thanks
-rich

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



Re: [PHP-DB] PHP and MySQL 5.0 stored procedures

2005-03-11 Thread mohamed naazir
plese don't ask qustion i am now start to do php and my sql don't sent
any mail please





On Thu, 10 Mar 2005 20:37:02 +1100, Guy Harrison
[EMAIL PROTECTED] wrote:
 Hi all,
 
 I'm new to PHP, but have been doing a lot of work with the MySQL 5.0 alphas
 looking at the stored procedure implementation.  I wanted to work with
 stored procedures in the PHP mysqli interface, but it doesn't seem to be
 ready for them yet.
 
 The things I want to do with stored procedures that I can't seem to do yet
 are:
 
 *Create a prepared statement based on call stored proc (I get 'This
 command is not supported in the prepared statement protocol yet')
 *Retrieve the value of an OUT parameter from a stored procedure.  Eg,
 after I execute the stored procedure I should be able to look into a
 variable bound to the stored procedure and see the value put in there by the
 stored procedure.
 *Retrieve multiple result sets from the stored procedure.  Stored
 procedures can return any number of result sets, so I'm looking for somthing
 like the multi_query call to operate against a prepared statement.
 
 I'm wondering if anyone knows if there is any activity around getting mysqli
 ready for 5.0, and if there is any advanced info about how it might work.
 
 Thanks,
 Guy
 
 [EMAIL PROTECTED]
 
 --
 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] PHP and MySQL 5.0 stored procedures

2005-03-10 Thread Guy Harrison
Hi all,

I'm new to PHP, but have been doing a lot of work with the MySQL 5.0 alphas
looking at the stored procedure implementation.  I wanted to work with
stored procedures in the PHP mysqli interface, but it doesn't seem to be
ready for them yet.

The things I want to do with stored procedures that I can't seem to do yet
are:

*Create a prepared statement based on call stored proc (I get 'This
command is not supported in the prepared statement protocol yet')
*Retrieve the value of an OUT parameter from a stored procedure.  Eg,
after I execute the stored procedure I should be able to look into a
variable bound to the stored procedure and see the value put in there by the
stored procedure.
*Retrieve multiple result sets from the stored procedure.  Stored
procedures can return any number of result sets, so I'm looking for somthing
like the multi_query call to operate against a prepared statement.

I'm wondering if anyone knows if there is any activity around getting mysqli
ready for 5.0, and if there is any advanced info about how it might work.

Thanks,
Guy

[EMAIL PROTECTED]

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



Re: [PHP-DB] PHP and mysql script error in webhosting

2004-08-10 Thread Torsten Roehr
Robby Russell [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Mon, 2004-08-09 at 20:45, Sukanto Kho wrote:
  Hi all,
 
  My php files run well in my local PC
  but some of PHP and mysql script just getting error when running in
webhosting server.
 
  I found out that the problem is in the way webhosting server handling
global variable.
  for example :
  In my local PC : $_GET['var'] is different with $var
  but in webhosting server : $GET['var'] is the same with $var... I
don't need to declare $var=$_GET['var'] 'cause $var is the same with
$_GET['var']...
 
  Anyone have such a problem before?
 
  Thanx
 
  By regard;
  Flame

 Yes, you will need to turn off global variables.

 You can do this (if using Apache), add a file to your main web directory
 called, .htaccess.

 An example .htaccess entry: php_flag register_globals on.

 Then try then find another webhost as that's a lame/insecure setting
 to have set to On. ;-)

 -Robby

register_globals itself is no direct security hole - it's the way the
application is handling the data that might be insecure.

ISPs that have been offering PHP for years just CANNOT turn off
register_globals easily as it could break the code of thousands of their
clients. You shouldn't judge an ISP from their register_globals setting ;)

Regards, Torsten Roehr

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



[PHP-DB] PHP and mysql script error in webhosting

2004-08-09 Thread Sukanto Kho
Hi all,

My php files run well in my local PC 
but some of PHP and mysql script just getting error when running in webhosting server.

I found out that the problem is in the way webhosting server handling global variable. 
for example : 
In my local PC : $_GET['var'] is different with $var
but in webhosting server : $GET['var'] is the same with $var... I don't need to 
declare $var=$_GET['var'] 'cause $var is the same with $_GET['var']...

Anyone have such a problem before? 

Thanx

By regard;
Flame

Re: [PHP-DB] PHP and mysql script error in webhosting

2004-08-09 Thread Robby Russell
On Mon, 2004-08-09 at 20:45, Sukanto Kho wrote:
 Hi all,
 
 My php files run well in my local PC 
 but some of PHP and mysql script just getting error when running in webhosting 
 server.
 
 I found out that the problem is in the way webhosting server handling global 
 variable. 
 for example : 
 In my local PC : $_GET['var'] is different with $var
 but in webhosting server : $GET['var'] is the same with $var... I don't need to 
 declare $var=$_GET['var'] 'cause $var is the same with $_GET['var']...
 
 Anyone have such a problem before? 
 
 Thanx
 
 By regard;
 Flame

Yes, you will need to turn off global variables.

You can do this (if using Apache), add a file to your main web directory
called, .htaccess.

An example .htaccess entry: php_flag register_globals on.

Then try then find another webhost as that's a lame/insecure setting
to have set to On. ;-)

-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
/

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



[PHP-DB] php to mysql client problem.

2004-02-07 Thread Michael G. Tracey


This is my setup: Not really worried about security.

W2kPro w\sp4
Mysql 5.O
Mysqlcc0.9.4
Php 5.0.0.b3 [As CGI]
Apache2.0.48

I can now connect to my server from anywhere using Mysqlcc or another server... home, 
work, etc.
I can run Php scripts.
I can connect to the Apache Server.

Login to Mysql: Works.
==C:\mysql -u mike -p
==Enter password: 
==Welcome to the MySQL monitor. Commands end with ; or \g.
==Your MySQL connection id is 28 to server version: 5.0.0-alpha-max-nt

==Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


PhpInfo Shows:

==MySQL Support enabled
==Active Persistent Links  0
==Active Links  0
==Client API version  3.23.57

==Directive  Local Value  Master Value
==mysql.allow_persistent  On  On
==mysql.connect_timeout  60  60
==mysql.default_host  localhost  localhost
==mysql.default_password  no value  no value
==mysql.default_port  3306  3306
==mysql.default_socket  no value  no value
==mysql.default_user  root  root
==mysql.max_links  Unlimited  Unlimited
==mysql.max_persistent  Unlimited  Unlimited
==mysql.trace_mode  Off  Off


I Try to connect from PHP and I get:
==Not connected : Client does not support authentication protocol ==requested by 
server; consider upgrading MySQL client

Could this be the Reason?: From the PHP info above.
==Client API version  3.23.57==

I'm thinking yes, but since copying the new files to the same directory overwrote all 
the others, is this the client version for all servers currently?? If not how do I 
force it to update.

I have all the servers working. I don't really at this point want to delete anything.



Michael G. Tracey

___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

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



[PHP-DB] php and MySQL and PostgresSQL at the same time

2003-10-02 Thread Morten Gulbrandsen
Is it possible to use PHP under one Apache WEB application in order to
access

MySQL and at the same time PostgreSQL?



different databases ?



Yours Sincerely



Morten Gulbrandsen

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



Re: [PHP-DB] php and MySQL and PostgresSQL at the same time

2003-10-02 Thread jeffrey_n_Dyke

I use Apache with PHP using MSSQL and MySQL at the same time...

You'd just need to connect to different databases, the platform should not
matter.

hth
Jeff


   
 
  Morten  
 
  Gulbrandsen To:   [EMAIL PROTECTED] 
  
  [EMAIL PROTECTED]cc:
  
  e   Subject:  [PHP-DB] php and MySQL and 
PostgresSQL at the same time
   
 
  10/02/2003 07:22 
 
  AM   
 
   
 
   
 




Is it possible to use PHP under one Apache WEB application in order to
access

MySQL and at the same time PostgreSQL?



different databases ?



Yours Sincerely



Morten Gulbrandsen

--
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] php and MySQL and PostgresSQL at the same time

2003-10-02 Thread Martin Marques
El Jue 02 Oct 2003 08:22, Morten Gulbrandsen escribió:
 Is it possible to use PHP under one Apache WEB application in order to
 access

 MySQL and at the same time PostgreSQL?



 different databases ?

Depends on how the question was made.
Yes you can access diferent database engines from the same PHP (if you have 
the modules loaded (or built-in support)).
What you can't do is access simultanously both databases in one query.

-- 
 09:31:01 up 41 days,  1:13,  3 users,  load average: 1.77, 1.75, 1.13
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

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



[PHP-DB] PHP 4.2.3 MySQL mysql_query quoting syntax.

2003-07-10 Thread Vampyr Twilight
Greetings,

Prior to PHP 4.2.3, when inserting values from an array into mysql I could
do the following:
(assuming that $a is an array())

$qid = mysql_query( INSERT  INTO  table  (info)  VALUES ('$a[2]')  );

However this logic now fails with the following error:
Parse error: parse error, expecting `']'' in /path/to/script/my_query.php on
line 123

Thus making me have to rewrite the query as:

$qid = mysql_query( INSERT  INTO  table  (info)  VALUES ( ' .$a[2]. ' )
);

What happened?  Is this just a PHP.INI setting, or was PHP just being
leanent and now it's gotten strict and being a bully about this?  .. I would
really prefer not to have to re-write my entire projects queries because of
this change.  Any information on how to go back to the old behaviour or why
the old behaviour is now unacceptable are greatly apprecaited.

Thank you,
-V. Twilight ;.,


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



[PHP-DB] ?? php and mysql database question ??

2003-06-07 Thread JeRRy
Hello,

I have a question, not sure if what I am looking for
is available at all or a smaller program of the full
sized program I am looking for but thought I'd ask to
see if anyone knows of a program or a program they may
of created.

On my personal Computer I run a Windows OS and on my
server (located elsewhere) I run a linux OS.  Now on
my server I have PHP 4.0 installed as well as mysql
database installed.  But I am not always available
online to update the website/databse and wondered if
there is a way to do updates/tests my my personal
computer.  Test them offline and put them live when I
am happy with it.

The thing is on my personal computer I run a Windows
OS and was wondering if there is a program I can
install to have mysql database or a similar program to
mysql database to run my scripts offline?

I already have installed a PHP program that I can
run/test PHP scripts and thought I'd ask here if
anyone knew of a mysql one.  (I thought since a PHP
program is available on Windows OS maybe a mysql one
was too?)

If anyone can help me that would be great.  If not, it
was worth a shot!

If anyone has another idea of doing things offline let
me know, I am all ears.  (e.g. a similar database
program to mysql I can download for Windows OS .. I
don't mean MS ACCESS etc, needs to be linux like so I
can test my scripts offline and make MINOR  edits to
get it to work with mysql.  But would prefer a mysql
program if available.)

I need the program so I can test my PHP pages and do
database changes to work with my PHP pages.  As I do
on my live website.  (e.g. retrieve data from a
database, and send data to a database. etc...)

I'm not aware of a program for mysql on Windows OS but
thought to ask here and see if any of you people do or
know any in development.

Thanks for your time in advance.

Kind Regards,
Jerry



http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



Re: [PHP-DB] ?? php and mysql database question ??

2003-06-07 Thread Allowee
 I already have installed a PHP program that I can
 run/test PHP scripts and thought I'd ask here if
 anyone knew of a mysql one.  (I thought since a PHP
 program is available on Windows OS maybe a mysql one
 was too?)

There is...

http://www.mysql.com/ for more info

.: Allowee


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



[PHP-DB] PHP and MySQL 4

2003-03-30 Thread Benjamin Higgins
Does PHP have support for MySQL 4?  If I install MySQL 4, and rebuild PHP
with --with-mysql, is that sufficient to get MySQL 4 support?

Ben



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



Re: [PHP-DB] PHP and MySQL 4

2003-03-30 Thread Jason Wong
On Monday 31 March 2003 04:46, Benjamin Higgins wrote:
 Does PHP have support for MySQL 4?  If I install MySQL 4, and rebuild PHP
 with --with-mysql, is that sufficient to get MySQL 4 support?

Yes.

-- 
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
--
/*
I often quote myself; it adds spice to my conversation.
-- G. B. Shaw
*/


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



RE: [PHP-DB] PHP and MySQL 4

2003-03-30 Thread Luke Woollard
Sure does - sure is.


-Original Message-
From: Benjamin Higgins [mailto:[EMAIL PROTECTED]
Sent: Monday, 31 March 2003 6:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP and MySQL 4


Does PHP have support for MySQL 4?  If I install MySQL 4, and rebuild PHP
with --with-mysql, is that sufficient to get MySQL 4 support?

Ben



-- 
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] PHP to mysql to email

2003-03-09 Thread JeRRy
Hi,

I have a PHP page that writes to a mysql database. 
Now I have got that bit to work well.  Now I want to
send out an email once a person submits the details. 
So on the database I grab fields like name, gender,
email etc...  Now I want to grab the email and send
out an email something like below once they submit
their details.

Dear name,

Thankyou for signing up, please visit...

Thanks!

Now name is fetched from the name they give on the
form.  So how would I send an email out automatically
once they submit it?

Also, but not really required yet but ideas
appreciated, if the email BOUNCES is their a way to
remove the entry that the email bounced email matches?
 I'd say this would be more complicated but any
suggestions are welcome on this.  I could always
manually remove them for the time being.

Jerry

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



Re: [PHP-DB] PHP to mysql to email

2003-03-09 Thread Jason Wong
On Monday 10 March 2003 10:44, JeRRy wrote:

 Now name is fetched from the name they give on the
 form.  So how would I send an email out automatically
 once they submit it?

mail()

 Also, but not really required yet but ideas
 appreciated, if the email BOUNCES is their a way to
 remove the entry that the email bounced email matches?

Search archives (php-general) for mail bounce or mailing list bounce or 
similar.

-- 
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
--
/*
No line available at 300 baud.
*/


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



RE: [PHP-DB] PHP-WIN MYSQL Double results

2003-01-30 Thread Hutchins, Richard
Post your code.

 -Original Message-
 From: Chris Deam [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 30, 2003 2:27 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] PHP-WIN MYSQL Double results
 
 
 Please help:
 
 I am getting double results when loading an html/php page.  I am not
 duplicating the query nor the while loop.  MYSQL console 
 returns single
 rows, meaning that the data has not been entered into the 
 database twice.
 Any ideas?
 
 Thanks in Advance,
 Chris Deam
 
 
 
 -- 
 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] Php and mysql, a rookie problem.

2003-01-20 Thread Rafael Santos Garcia
Hi, I had already install mysql and php,  the apache was in my linux 
distribution (Mandrake) and also one php, but i have install the last 
version in rpm.

I have stop and start the apache, and the php works without any problem. 
But when i call to a mysql function in the php code its give to me an 
error. This code is really simple, is only to prove that all works.

The code is only the line :

?
mysql_connect (aw, aw, pass);

?

I prove in my Galeon and gives to me the error: Fatal error: Call to 
undefined function: mysql_connect() in /var/www/html/aw/copia.php on line 10

I do not now why give this error, the php works and in the php.ini I 
have include the line extension = mysql.so

Is suppose that with this all must work, but it doesnt work.

Anyone have any idea about why this dont work, i'm sure that must be a 
stupid error.

Thanks.




RE: [PHP-DB] PHP and mySQL help!

2003-01-12 Thread John W. Holmes
It looks like the problems is because $date and $host are in different
form tags. So if one is set, then the other won't be. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Dzung Nguyen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 10, 2003 1:33 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] PHP and mySQL help!
 
 Thanks for the quick reply!  Perhaps I should describe my problem more
 specifically so that u could have a better idea:
 
 The code on PHP page to create forms for users to input field names:
 
 $tempdate = $date ;
 $tempselect = $select ;
 echo font size=$fontsize-1Choose datebr/font
 form action=\build_form.php\ target=\_top\ method=get
 input type=hidden name=\select\ value=\$tempselect\
 input type=hidden name=\order\ value=\$order\
 input type=hidden name=\ordertwo\ value=\$ordertwo\
 input type=hidden name=\way\ value=\$way\
 input type=hidden name=\waytwo\ value=\$waytwo\
 input type=\text\ name=\date\ value=\$tempdate\ size=17
 maxlength=10/form ;
 echo /table ;
 
 $temphost = $host;
 echo font size=$fontsize-1Choose hostbr/font
 form action=\build_form.php\ target=\_top\ method=get
 input type=hidden name=\select\ value=\$tempselect\
 input type=hidden name=\order\ value=\$order\
 input type=hidden name=\ordertwo\ value=\$ordertwo\
 input type=hidden name=\way\ value=\$way\
 input type=hidden name=\waytwo\ value=\$waytwo\
 input type=\text\ name=\host\ value=\$temphost\ size=17
 maxlength=10/form ;
 echo /table ;
 
 I then would concat the values to query the database as follow:
 
  echo a

href=\build_form.php?select=alldate=$datehost=$hostorder=$orderorde
rt
 wo=$ordertwoway=$waywaytwo=$waytwo\
 target=\_top\
 
 My problem right now is that I can't seem to keep both values.  If one
 value is update (host for example), the other value (date) is no
longer
 set???
 Thanks again for your help.
 
 
 --
 Dzung V. Nguyen email: [EMAIL PROTECTED]
 Alpha Linux Group   http://linux.iol.unh.edu/clp
 InterOperability Laboratory
 University of New Hampshire phone: (603) - 862 - 0401
 Durham, NH 03824fax  : (603) - 862 - 4181
 
 




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




[PHP-DB] PHP and mySQL help!

2003-01-10 Thread Dzung Nguyen
Hi!  I have a PHP page with a few text areas where users can enter 
different combination of fields to query a mySQL database.  An example 
of a query would be like this:

$query = SELECT build_ids.build_id, build_ids.username, build_ids.host,
build_ids.configuration, build_ids.build, 
build_ids.target, build_tests.input,
build_tests.output, build_tests.result, 
build_tests.test_name,
build_tests.prms_id, build_ids.date FROM build_ids, 
build_tests
WHERE build_ids.date like \$date%\  and 
build_ids.host like \$host\ and
build_ids.build_id like build_tests.build_id;

The query would work if I use mySQL from command line, w/o using the 
variable, but use the field names themselves.  But wouldn't work when I 
try to use variable like above and set the variables from a PHP page. 
Anybody knows what's wrong w/ my code or could show me to some helpful 
resources?  Please reply to this email as I am not a subscriber of this 
list.  Thank you very much!  I really appreciate your help!  

--
Dzung V. Nguyen email: [EMAIL PROTECTED]
Alpha Linux Group   http://linux.iol.unh.edu/clp
InterOperability Laboratory
University of New Hampshire phone: (603) - 862 - 0401
Durham, NH 03824fax  : (603) - 862 - 4181




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



RE: [PHP-DB] PHP and mySQL help!

2003-01-10 Thread John W. Holmes
Are you sure $date and $host have a value? Is register globals on or
off? Echo your query to the screen before you execute it to make sure
it's what you think it is. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Dzung Nguyen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 10, 2003 12:45 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] PHP and mySQL help!
 
 Hi!  I have a PHP page with a few text areas where users can enter
 different combination of fields to query a mySQL database.  An example
 of a query would be like this:
 
 $query = SELECT build_ids.build_id, build_ids.username,
build_ids.host,
  build_ids.configuration, build_ids.build,
 build_ids.target, build_tests.input,
  build_tests.output, build_tests.result,
 build_tests.test_name,
  build_tests.prms_id, build_ids.date FROM
build_ids,
 build_tests
  WHERE build_ids.date like \$date%\  and
 build_ids.host like \$host\ and
  build_ids.build_id like build_tests.build_id;
 
 The query would work if I use mySQL from command line, w/o using the
 variable, but use the field names themselves.  But wouldn't work when
I
 try to use variable like above and set the variables from a PHP page.
  Anybody knows what's wrong w/ my code or could show me to some
helpful
 resources?  Please reply to this email as I am not a subscriber of
this
 list.  Thank you very much!  I really appreciate your help!
 
 --
 Dzung V. Nguyen email: [EMAIL PROTECTED]
 Alpha Linux Group   http://linux.iol.unh.edu/clp
 InterOperability Laboratory
 University of New Hampshire phone: (603) - 862 - 0401
 Durham, NH 03824fax  : (603) - 862 - 4181
 
 
 
 
 --
 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] PHP and mySQL help!

2003-01-10 Thread Dzung Nguyen
Thanks for the quick reply!  Perhaps I should describe my problem more 
specifically so that u could have a better idea:

The code on PHP page to create forms for users to input field names:

$tempdate = $date ;
$tempselect = $select ;
echo font size=$fontsize-1Choose datebr/font
   form action=\build_form.php\ target=\_top\ method=get
   input type=hidden name=\select\ value=\$tempselect\
   input type=hidden name=\order\ value=\$order\
   input type=hidden name=\ordertwo\ value=\$ordertwo\
   input type=hidden name=\way\ value=\$way\
   input type=hidden name=\waytwo\ value=\$waytwo\
   input type=\text\ name=\date\ value=\$tempdate\ size=17 
maxlength=10/form ;
echo /table ;

$temphost = $host;
echo font size=$fontsize-1Choose hostbr/font
   form action=\build_form.php\ target=\_top\ method=get
   input type=hidden name=\select\ value=\$tempselect\ 
   input type=hidden name=\order\ value=\$order\
   input type=hidden name=\ordertwo\ value=\$ordertwo\
   input type=hidden name=\way\ value=\$way\
   input type=hidden name=\waytwo\ value=\$waytwo\
   input type=\text\ name=\host\ value=\$temphost\ size=17 
maxlength=10/form ;
echo /table ;

I then would concat the values to query the database as follow:

echo a 
href=\build_form.php?select=alldate=$datehost=$hostorder=$orderordertwo=$ordertwoway=$waywaytwo=$waytwo\ 
target=\_top\

My problem right now is that I can't seem to keep both values.  If one 
value is update (host for example), the other value (date) is no longer 
set???
Thanks again for your help.


--
Dzung V. Nguyen email: [EMAIL PROTECTED]
Alpha Linux Group   http://linux.iol.unh.edu/clp
InterOperability Laboratory
University of New Hampshire phone: (603) - 862 - 0401
Durham, NH 03824fax  : (603) - 862 - 4181




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



RE: [PHP-DB] PHP and mySQL help!

2003-01-10 Thread Hutchins, Richard
If you update $date and nothing else on the page, are any of the other
values in the URL (HREF) set? You have two separate forms.  $date is in one
and $host is in the other. However, all of the other variables in your URL
(HREF) are from the second form where $host is. My guess is that since you
have information coming from two separate forms, only data from one of the
forms is being submitted. I might be totally wrong though because I don't
know what happens when you use two forms on the same page, let alone two
forms without names.

If my theory is right, you should be able to use one form to encompass all
of the data and use two separate tables within the form to format the
controls on the page.

Hope this helps.
 -Original Message-
 From: Dzung Nguyen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 10, 2003 1:33 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] PHP and mySQL help!
 
 
 Thanks for the quick reply!  Perhaps I should describe my 
 problem more 
 specifically so that u could have a better idea:
 
 The code on PHP page to create forms for users to input field names:
 
 $tempdate = $date ;
 $tempselect = $select ;
 echo font size=$fontsize-1Choose datebr/font
 form action=\build_form.php\ target=\_top\ method=get
 input type=hidden name=\select\ value=\$tempselect\
 input type=hidden name=\order\ value=\$order\
 input type=hidden name=\ordertwo\ value=\$ordertwo\
 input type=hidden name=\way\ value=\$way\
 input type=hidden name=\waytwo\ value=\$waytwo\
 input type=\text\ name=\date\ 
 value=\$tempdate\ size=17 
 maxlength=10/form ;
 echo /table ;
 
 $temphost = $host;
 echo font size=$fontsize-1Choose hostbr/font
 form action=\build_form.php\ target=\_top\ method=get
 input type=hidden name=\select\ value=\$tempselect\ 
 input type=hidden name=\order\ value=\$order\
 input type=hidden name=\ordertwo\ value=\$ordertwo\
 input type=hidden name=\way\ value=\$way\
 input type=hidden name=\waytwo\ value=\$waytwo\
 input type=\text\ name=\host\ 
 value=\$temphost\ size=17 
 maxlength=10/form ;
 echo /table ;
 
 I then would concat the values to query the database as follow:
 
  echo a 
 href=\build_form.php?select=alldate=$datehost=$hostorder=$
 orderordertwo=$ordertwoway=$waywaytwo=$waytwo\ 
 target=\_top\
 
 My problem right now is that I can't seem to keep both 
 values.  If one 
 value is update (host for example), the other value (date) is 
 no longer 
 set???
 Thanks again for your help.
 
 
 -- 
 Dzung V. Nguyen email: [EMAIL PROTECTED]
 Alpha Linux Group   http://linux.iol.unh.edu/clp
 InterOperability Laboratory
 University of New Hampshire phone: (603) - 862 - 0401
 Durham, NH 03824fax  : (603) - 862 - 4181
 
 
 
 
 -- 
 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] php and mysql on RH8.0

2002-12-29 Thread franco stridella

Hi,

i apologize in advance for my stupid question. I installed RedHat8.0 with built in 
apache 2 and php 4.2.2

By looking at phpinfo() i see that php has been compiled with --with-mysql,shared and 
php works but it seems that mysql is not enabled. Why? how can i use mysql with php? 
what have i to enable to make it run?

bye

 



-
Yahoo! Cellulari: scarica i loghi e le suonerie per le tue feste!


AW: [PHP-DB] php and mysql on RH8.0

2002-12-29 Thread Claudia Schasiepen
Hi Franco,

did you install MySql? Check http://www.mysql.com/ to get the newest
release.
Best regards
Claudia

-Ursprüngliche Nachricht-
Von: franco stridella [mailto:[EMAIL PROTECTED]]
Gesendet: Sonntag, 29. Dezember 2002 16:47
An: [EMAIL PROTECTED]
Betreff: [PHP-DB] php and mysql on RH8.0



Hi,

i apologize in advance for my stupid question. I installed RedHat8.0 with
built in apache 2 and php 4.2.2

By looking at phpinfo() i see that php has been compiled
with --with-mysql,shared and php works but it seems that mysql is not
enabled. Why? how can i use mysql with php? what have i to enable to make it
run?

bye





-
Yahoo! Cellulari: scarica i loghi e le suonerie per le tue feste!



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




Re: [PHP-DB] php and mysql on RH8.0

2002-12-29 Thread Doug Thompson
1.  Is mysqld running?  I don't remember if the default configuration
for RH8.0 sets it to start on system boot.

The easy way to check is:

ps aux | grep mysql

or

mysqladmin -u root ping

will return MySQL is alive if the server is running.

2.  See chapter 2.4 of the MySQL Manual for Post-installation Setup and
Testing

http://www.mysql.com/doc/en/Post-installation.html

hth,
Doug

On Sun, 29 Dec 2002 16:46:38 +0100 (CET), franco stridella wrote:


Hi,

i apologize in advance for my stupid question. I installed RedHat8.0 with built in 
apache 2 and php 4.2.2

By looking at phpinfo() i see that php has been compiled with --with-mysql,shared and 
php works but it seems that mysql is not enabled. Why? how can i use mysql with php? 
what have i to enable to make it run?

bye



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




[PHP-DB] PHP and MySQL

2002-12-25 Thread JabMaster
Hello,

I have created a website (www.mirax.cz) with a database mysql 3.23.33 and used PHP 
4.0.4pl1. Everything functions perfect ONLY at my W98. As soon as I want to use the 
same database exported to linux(PHP 4.2.2) or w2000(PHP 4.2.3) both with mysql 
3.23.54, it has problems like this:

Notice: Undefined variable: kategorie in c:\inetpub\wwwroot\mirax\search\search.php on 
line 37
even if  kategorie  IS defined and the same PHP script works in w98, PHP 4.0.4pl1


In w2000 even my simple contact form (NOT USING THE DATABASE) is giving me the same 
error:
Notice: Undefined variable: jmeno in c:\inetpub\wwwroot\jab\kontakt.php on line 3 - 
even if  jmeno is defined and this form works in w98, PHP 4.0.4pl1




WHAT SHOULD I DO ??

 
Thank you for any suggestions.



jab



 


Re: [PHP-DB] PHP and MySQL

2002-12-25 Thread Doug Thompson
The simplest solution is to edit php.ini on your Linux box and set the
parameter register_globals to ON.  As of PHP4.2.0 the default setting
is OFF and new super globals are available.
A better solution is to update your windows box to the same version of
PHP so that you are programming to the improved security properties.

Here is a good article to explain what's going on and point you to even
more info:
Title:  Coding PHP with Register Variables OFF

http://www.zend.com/zend/art/art-sweat4.php

hth,
Doug


On Wed, 25 Dec 2002 13:22:20 +0100, JabMaster wrote:

Hello,

I have created a website (www.mirax.cz) with a database mysql 3.23.33 and used PHP 
4.0.4pl1. Everything functions perfect ONLY at my W98. As soon as I want to use the 
same database exported to linux(PHP 4.2.2) or w2000(PHP 4.2.3) both with mysql 
3.23.54, it has problems like this:

Notice: Undefined variable: kategorie in c:\inetpub\wwwroot\mirax\search\search.php 
on line 37
even if  kategorie  IS defined and the same PHP script works in w98, PHP 4.0.4pl1


In w2000 even my simple contact form (NOT USING THE DATABASE) is giving me the same 
error:
Notice: Undefined variable: jmeno in c:\inetpub\wwwroot\jab\kontakt.php on line 3 - 
even if  jmeno is defined and this form works in w98, PHP 4.0.4pl1




WHAT SHOULD I DO ??

 
Thank you for any suggestions.



jab



 



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




Re: [PHP-DB] php and mysql

2002-12-07 Thread David Smith
Three words:

php dot net

--Dave

On Fri, 2002-12-06 at 23:19, Jason Wong wrote:
 On Saturday 07 December 2002 11:54, Dallas wrote:
  hey, i'm just new to using php and mysql
 
  i would like to know how to do the following for a assignment of mine
  (shopping site):-
 
  and if I could ask for full codes, and only relevant coding, no extra stuff
  plz
 
 Should you be asking for a quotation as well?
 
  *connect to the mysql database and display results in random areas of the
  page
  (the prices of the items will be displayed in different areas)
 
  *connect to a mysql database and show the results on the form in the text
  fields
  (basically so that they can see the current price on the form before they
  edit it)
 
  *change the prices after submission of the form into the mysql database
 
  THANKS A LOT, it will really help
 
 I bet it will ;-)
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 
 
 /*
 Most people in this society who aren't actively mad are, at best,
 reformed or potential lunatics.
   -- Susan Sontag
 */
 
 
 -- 
 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] php and mysql

2002-12-06 Thread Dallas
hey, i'm just new to using php and mysql

i would like to know how to do the following for a assignment of mine
(shopping site):-

and if I could ask for full codes, and only relevant coding, no extra stuff
plz

*connect to the mysql database and display results in random areas of the
page
(the prices of the items will be displayed in different areas)

*connect to a mysql database and show the results on the form in the text
fields
(basically so that they can see the current price on the form before they
edit it)

*change the prices after submission of the form into the mysql database

THANKS A LOT, it will really help

dallas freeman



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




Re: [PHP-DB] php and mysql

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 11:54, Dallas wrote:
 hey, i'm just new to using php and mysql

 i would like to know how to do the following for a assignment of mine
 (shopping site):-

 and if I could ask for full codes, and only relevant coding, no extra stuff
 plz

Should you be asking for a quotation as well?

 *connect to the mysql database and display results in random areas of the
 page
 (the prices of the items will be displayed in different areas)

 *connect to a mysql database and show the results on the form in the text
 fields
 (basically so that they can see the current price on the form before they
 edit it)

 *change the prices after submission of the form into the mysql database

 THANKS A LOT, it will really help

I bet it will ;-)

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Most people in this society who aren't actively mad are, at best,
reformed or potential lunatics.
-- Susan Sontag
*/


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




[PHP-DB] PHP and MySQL form problem - Undifined variables

2002-10-25 Thread Mario Montag
First time playing with PHP, Apache, and MySQL.  I have a simple form error
and I don't know how to solve it.  I was doing the Webmonkey PHP/MySQL
tutorial and when I started using forms with $PHP_SELF I started getting
errors with variables not defined.

PHP 4.2.3
MySQL 4.0 Windows 2000
Apache 1.3.27 (Since I was not able to get 2.0 working on Windows 2K Pro)

My code is:

//--  START OF CODE --
htmlbody?php

$db = mysql_connect(localhost, root);
mysql_select_db(mydb,$db);
$result = mysql_query(SELECT * FROM employees,$db);

if ($myrow = mysql_fetch_array($result)) {
  do {
printf(
 a href=\%s?id=%s\%s %s/abr\n,
 $PHP_SELF,
 $myrow[id],
 $myrow[first],
 $myrow[last]
);
  } while ($myrow = mysql_fetch_array($result));
}

else {
  echo Sorry, no records were found!;
}

?
/body/html

//--  END OF CODE  ---

My ERROR is:

Notice: Undefined variable: PHP_SELF in C:\Program Files\Apache
Group\Apache\htdocs\mysql2.php on line 11
Bob Smith

Notice: Undefined variable: PHP_SELF in C:\Program Files\Apache
Group\Apache\htdocs\mysql2.php on line 11
John Roberts

Notice: Undefined variable: PHP_SELF in C:\Program Files\Apache
Group\Apache\htdocs\mysql2.php on line 11
Brad Johnson

Notice: Undefined variable: PHP_SELF in C:\Program Files\Apache
Group\Apache\htdocs\mysql2.php on line 11
Mar f

---  END OF ERROR  

I am able to connect to the MySQL DB and retrieve info, but I don't get the
error.  I changed the REGISTER_GLOBALS of the php.ini file to ON and I still
get the variables error.  I also added $_POST  as stated in another form
issue but it did not resolve my problem.  It must be simple but I don't know
enough to identify the issue.

Thanks for any help or input.

Mario
[EMAIL PROTECTED]







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




[PHP-DB] PHP mail + MySQL

2002-10-23 Thread Maarten Verheijen Mysql en PHP-maillijst
Dear Readers,

Is there anybody who nows about a php-script which can be used to download email from
a pop-account and then put the e-mailmessages and their attachments into a MySQL 
database.

I want to use it to create a database of all e-mailmessages send to our company. This 
will greatly help
us because as an online shop we are buried in mail.

Probaly I'll will be able to script against it so our employees can answer e-mail from 
a php-webpage and
maybe even write a script to put the names and adresses of the senders into a 
LDAP-server.

Thanx,
Maarten Verheijen



Re: [PHP-DB] php - checkboxes - mysql

2002-09-10 Thread Ignatius Reilly

Try something like this:

 INPUT type=checkbox
 name=?php echo( $row['name'] ) ; ?
 value=1
 ?php echo( $row['homeno'] == 0 ?   : checked ) ; ?
 

(value is a dummy value - HTML will POST the name=value pair only if
checked.)

HTH

Ignatius

- Original Message -
From: Chris [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 09, 2002 11:03 PM
Subject: [PHP-DB] php - checkboxes - mysql


 Greetings,

 I am just starting with php and need some help/code example for
 setting checkbox values from mysql. My setup is the following:

 The mysql database holds data and checkbox values in respective columes.
 For example

 name address phone homeno workno pagerno
 Chris  555-1212 1 0 0

 1 = checkbox should be checked
 0 = checkbox should not be checked

 On the webpage side I would have name, address and phone number textboxes,
 and then 3 checkboxes for the homeno, workno and pagerno.

 When the page loads I would like to have the checkboxes be automatically
 checked or left uncheck based on the mysql query to the db. I do not want
 to do any grouping or anything, just query mysql for the homeno value, set
 it, then check the workno value, set it, etc..

 Any help is GREATLY appreciated.
 Chris



 --
 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




Fw: [PHP-DB] php - checkboxes - mysql

2002-09-10 Thread nikos


 You should first check if checkbox value stored in the databese is 1 or 0.
 After use an if clause:
 if ($checkbox==1) {
 echo input type=\checkbox\ name=\checkbox\ value=\1\ checked
 }
 elseif ($checkbox==0) {
 input type=\checkbox\ name=\checkbox\ value=\0\
 }

 Nikos
 --
--
 ---

 - Original Message -
 From: Chris [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, September 10, 2002 12:03 AM
 Subject: [PHP-DB] php - checkboxes - mysql


  Greetings,
 
  I am just starting with php and need some help/code example for
  setting checkbox values from mysql. My setup is the following:
 
  The mysql database holds data and checkbox values in respective columes.
  For example
 
  name address phone homeno workno pagerno
  Chris  555-1212 1 0 0
 
  1 = checkbox should be checked
  0 = checkbox should not be checked
 
  On the webpage side I would have name, address and phone number
textboxes,
  and then 3 checkboxes for the homeno, workno and pagerno.
 
  When the page loads I would like to have the checkboxes be automatically
  checked or left uncheck based on the mysql query to the db. I do not
want
  to do any grouping or anything, just query mysql for the homeno value,
set
  it, then check the workno value, set it, etc..
 
  Any help is GREATLY appreciated.
  Chris
 
 
 
  --
  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] php - checkboxes - mysql

2002-09-10 Thread Hutchins, Richard

Also check the archives for the php-db list. Questions very similar to this
get asked just about every week and you might be able to find more
information there.

Rich

-Original Message-
From: nikos [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 7:51 AM
To: PHP-mailist
Subject: Fw: [PHP-DB] php - checkboxes - mysql



 You should first check if checkbox value stored in the databese is 1 or 0.
 After use an if clause:
 if ($checkbox==1) {
 echo input type=\checkbox\ name=\checkbox\ value=\1\ checked
 }
 elseif ($checkbox==0) {
 input type=\checkbox\ name=\checkbox\ value=\0\
 }

 Nikos
 --
--
 ---

 - Original Message -
 From: Chris [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, September 10, 2002 12:03 AM
 Subject: [PHP-DB] php - checkboxes - mysql


  Greetings,
 
  I am just starting with php and need some help/code example for
  setting checkbox values from mysql. My setup is the following:
 
  The mysql database holds data and checkbox values in respective columes.
  For example
 
  name address phone homeno workno pagerno
  Chris  555-1212 1 0 0
 
  1 = checkbox should be checked
  0 = checkbox should not be checked
 
  On the webpage side I would have name, address and phone number
textboxes,
  and then 3 checkboxes for the homeno, workno and pagerno.
 
  When the page loads I would like to have the checkboxes be automatically
  checked or left uncheck based on the mysql query to the db. I do not
want
  to do any grouping or anything, just query mysql for the homeno value,
set
  it, then check the workno value, set it, etc..
 
  Any help is GREATLY appreciated.
  Chris
 
 
 
  --
  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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] php - checkboxes - mysql

2002-09-09 Thread Chris

Greetings,

I am just starting with php and need some help/code example for
setting checkbox values from mysql. My setup is the following:

The mysql database holds data and checkbox values in respective columes.
For example

nameaddress phone   homeno  workno  pagerno
Chris   555-12121   0   0

1 = checkbox should be checked
0 = checkbox should not be checked

On the webpage side I would have name, address and phone number textboxes,
and then 3 checkboxes for the homeno, workno and pagerno.

When the page loads I would like to have the checkboxes be automatically
checked or left uncheck based on the mysql query to the db. I do not want
to do any grouping or anything, just query mysql for the homeno value, set
it, then check the workno value, set it, etc..

Any help is GREATLY appreciated.
Chris



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




[PHP-DB] PHP amd MYSQL

2002-06-05 Thread Peter Goggin

I am setting up a web page system which involves html pages, php pages and
mysqldatabase.

I have a number of questions and do not know where to find answers.

If  I display the rows from a database table in a php generated html table
is it possible to mark a row so that it can be deleted or modified by
calling another php page? If so is this documented anywhere?

Is there any good source of information on setting up 'forms'to work like
Oracle forms where database records can be inserted, updated or deleted?


Regards


Peter Goggin




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




Fwd: [PHP-DB] PHP amd MYSQL

2002-06-05 Thread Terry Romine


 I'll add this snippet in to prevent accidental deletes:

 a href=delete.php?id=' . $row[id] . ' onClick='return confirm(\Do 
 you really want to delete this record?\)' ' . $row[name] . '/a

 On Wednesday, June 5, 2002, at 09:20  AM, 
 [EMAIL PROTECTED] wrote:

 One way to do it would be thusly:

 $result=mysql_query(yadayada);
 foreach($result as $row){
 echo '
 trtd
 a href=delete.php?id=' . $row[id] . '' . $row[name] . '/a
 ...
 /tr';
 }

 This would set up a url that when the user clicks on $row[name] (such 
 as
 Record Description it would call delete.php with the argument of 
 $row[id]

 Within that delete.php, you remove the selected record, then call the
 original page.

 Use:
 $sql=DELETE from table where id=$id;

 Then do:
 echo '
 Header(Location: original_location.php);

 You can't have any html previous to the Header command, though.

 This will return you to your original page where you can do your select
 again, and the deleted row won't show up.

 You may need to pass parameters on the Header line to let
 original_location.php exactly where you were previously. This would 
 have to
 be passed either on the url or as a post/get operation when first 
 calling
 delete.php

 Terry Romine
 Web Developer
 JumpInteractive.com



Re: [PHP-DB] PHP amd MYSQL

2002-06-05 Thread Miguel Carvalho

Hi,

 I am setting up a web page system which involves html pages, php pages
 and mysqldatabase.

 I have a number of questions and do not know where to find answers.

 If  I display the rows from a database table in a php generated html
 table is it possible to mark a row so that it can be deleted or
 modified by calling another php page?

I dont know if mysql supports select for update, but the locking will not
work. The reasons are:
   As soon the PHP page ends, PHP will realease all non persistent
   database connections.You can work around this, using a persistent connection( this 
type of
connection doesnt close even after the php script ends ), but this kind of
connection can bring you troubles. You will get troubles if you run insert
or update commands, because all script instances will share the same
database connection. If for some reason, a script( or the db server )
locks the table for some reason, all scripts that use the persistent connection
  will wait for the unlock of the table.Worse, if you rollback a transaction, every 
transactions that use the
persistent connection will be roolbacked.

Is there any reason to lock the rows?

If so is this documented
 anywhere?


 Is there any good source of information on setting up 'forms'to work
 like Oracle forms where database records can be inserted, updated or
 deleted?

I dont know. Sorry.

Regards
Miguel



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




[PHP-DB] PHP or MySQL are putting extra records into my DB file

2001-12-11 Thread Lynne

Using simple test scripts, I'm connecting to a MySQL DB through PHP after
inputting info into a form and hitting submit. Something is putting three
records instead of one into the mySQL DB.

For instance:
the two variables are: $event_title and $event_desc. These are gotten from
the form submitting to the PHP doc. The PHP code is as follows:

?php

$link = mysql_connect(localhost, llupien, dod2196);
if (! $link)
 die (Couldn't connect to MySQL);
mysql_select_db(scco) or die (Couldn't open database phptest);
$query = INSERT INTO events (title,description) values
('$event_title','$event_desc');
mysql_query($query, $link) or die (Couldn't add data to table:
.mysql_error());
mysql_close($link);

?


It's simple and I know the syntax is right...but in my simple little table,
I get three records - one correctly entered and two blanks. The two blanks
force the autonumber ID field to increment, but are completely blank
otherwise. Why would I get three records?

I use MySQL and PHP with my hosting service...they have PHPMyAdmin
installed...when you add a record from PHPMyAdmin, it works peachy. So
something PHP is working just fine, just not *my* scripts.

One of my theories is that it's something about the way I
connect...localhost may be wrong or need a port?? I've asked them over and
over what the connection requires but they don't seem to know what they're
talkign about. They keep telling me the pathway usr/local/mysql etc, but
can't tell me how to connect to the mySQL db's.

Anyway, it might be hopeless, but I'm hoping someone can lead me in the
right direction. Thanks!
Lynne



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP or MySQL are putting extra records into my DB file

2001-12-11 Thread Miles Thompson

Lynne,

1. Where are you testing for the action of the form?
2. What triggers the insert?

For more on this, have a look at the custom error tutorial put up by Julie 
Meloni at http://www.thickbook.com

Right now it looks as if you are inserting a record every time the page 
loads. So you would get a record on the initial load, when $event_title and 
$event_desc are empty, on the submit, when they have values, and on the 
following reload, if you do one.

Hope this helps - Miles Thompson

At 07:28 AM 12/9/2001 -0500, Lynne wrote:
Using simple test scripts, I'm connecting to a MySQL DB through PHP after
inputting info into a form and hitting submit. Something is putting three
records instead of one into the mySQL DB.

For instance:
the two variables are: $event_title and $event_desc. These are gotten from
the form submitting to the PHP doc. The PHP code is as follows:

?php

$link = mysql_connect(localhost, llupien, dod2196);
if (! $link)
  die (Couldn't connect to MySQL);
mysql_select_db(scco) or die (Couldn't open database phptest);
$query = INSERT INTO events (title,description) values
('$event_title','$event_desc');
mysql_query($query, $link) or die (Couldn't add data to table:
.mysql_error());
mysql_close($link);

?


It's simple and I know the syntax is right...but in my simple little table,
I get three records - one correctly entered and two blanks. The two blanks
force the autonumber ID field to increment, but are completely blank
otherwise. Why would I get three records?

I use MySQL and PHP with my hosting service...they have PHPMyAdmin
installed...when you add a record from PHPMyAdmin, it works peachy. So
something PHP is working just fine, just not *my* scripts.

One of my theories is that it's something about the way I
connect...localhost may be wrong or need a port?? I've asked them over and
over what the connection requires but they don't seem to know what they're
talkign about. They keep telling me the pathway usr/local/mysql etc, but
can't tell me how to connect to the mySQL db's.

Anyway, it might be hopeless, but I'm hoping someone can lead me in the
right direction. Thanks!
Lynne



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] php and mysql security problem

2001-11-28 Thread Jack

Dear all

I had a security problem with my homepage. I'm using the IIS 4 to host my
webpage, and i got the php to run as the script of the webpage and the
database i'm using for the database is mysql.
Here is my question :
There is a table in mysql which will let user to input some records to, then
the user will update and retreive the records.
But what i to do is limit the user update to the record which the user
should be.
I mean when user1 had insert a record into table, and he found out that
there is some update need to do for the record he just inset, so he update
that record. but i don't want other people can update his record.

Is there also possible for php to grab the username and password from the
window base which logged on to a Domain and pass it to MYSQL!!

Thx
Jack
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP accessing MySQL

2001-11-27 Thread Jonathan Duncan

OK, I have found some more time to work on my PHP project.  The problem is
indicated in the following line:

$tables = mysql_list_tables($db_names[$db_num]) or die(Couldn't list
databases.);

I took the variable $db_num and replaced it with a value of 1 as follows:

$tables = mysql_list_tables($db_names[1]) or die(Couldn't list
databases.);

The output gave me the following results:

The value of db_list is:
mysql
test
twignud
The value of dbs is: Resource id #2
The value of db_num is: 3

If I replace $db_num with a value of 0, 2 or 3 I get Couldn't list
databases.

Any ideas anyone?  Julie?  Miles?  Could this have anything to do with mysql
user permission?

Thanks,
jkd


Jonathan Duncan [EMAIL PROTECTED] wrote in message
9eekpb$s41$[EMAIL PROTECTED]">news:9eekpb$s41$[EMAIL PROTECTED]...
 YES!!  I just had a feeling the book was wrong.  That did get rid of the
 error.  However, it did not completely solve my issue.  Now when I run the
 script I just get the message Couldn't list databases.  This just
happens
 to be the die message for the same line of code that I have been looking
at:

$tables = mysql_list_tables($db_names[$db_num]) or die(Couldn't list
 databases.);

 It is almost as if it is not being able to even list the tables from the
 databases.  I am working right now on just listing the tables of a
database
 to see what happens.

 Thank you,
 jkd


 Julie Meloni [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I believe you want to look at this page:
  http://www.thickbook.com/books/phpfe_errata.phtml
 
 
 
  --
  ++
  | Julie Meloni ([EMAIL PROTECTED]) |
  ||
  | PHP Essentials and PHP Fast  Easy |
  |   http://www.thickbook.com |
  ++
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP and MySQL queries...

2001-10-25 Thread Steve Cayford

Yep, MySQL has DATE, DATETIME, and TIMESTAMP field types. You can order 
by them and everything.

-Steve

On Thursday, October 25, 2001, at 09:18  AM, Tim Foster wrote:

 I'm new to this list, to PHP and to MySQL (been doing VBScript on ASP 
 for several years,
 tho).

 I'm curious...

 If you're going to store it as an integer, why not store 10/24/2001 
 as MMDD
 (20011024). This gives you the added benefit of being able to have the 
 db sort your
 fields. This even works if you want to include the time with your date 
 (provided all dates
 in the field consistently contain the same *amount* of info). For 
 example, noon on
 Christmas will always be lower than noon of the following New Year ..as 
 it should be:

 /MM/DD20011225 20020101
 /MM/DD HH:MM  200112251200 200201011200
 /MM/DD HH:MM:SS   2001122512   2002010112

 I'm betting there's no easy way to sort it if you store it as MM/DD/YY

 MM/DD/10242001  12252001 (good)
 ..but NOT less than the following New Year's
 MM/DD/10242001  01012002 (bad)

 Granted, you might take up a bit more space in the DB, which would have 
 a tiny impact on
 performance(??), but an extra $100 on the hard drive would effectively 
 eliminate any
 reasonable space considerations and (IMHO) reduce the amount of 
 programming/debugging to
 more than justify the overhead.

 FWIW, M$ likes to store their dates as two integers: one to hold the 
 date portion, the
 other to hold the hours:minutes:seconds portion.

 If there's something about PHP/MySQL that makes this point moot, please 
 let me know.

 TIM
 -He who always plows a straight furrow is in a rut.


 -Original Message-
 From: Mike Frazer [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 24, 2001 7:54 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] PHP and MySQL queries...


 Agreed.  This is especially useful when you need to conserve every 
 byte you
 can; a timestamp of 10/24/2001 or something similar is going to take 
 10
 bytes as a string and an indeterminate number of bytes for an actual
 timestamp because of system variations, whereas an integer value of 
 10242001
 will take you 2-4 bytes depending on the type of int you declare.  Not 
 a lot
 of space, but assume for a second you have 30 fields in your database 
 and 5
 million rows...suddenly those 6-8 bytes have multiplied on this one 
 field
 alone.  Space and speed are important in DBs :)

 Mike Frazer


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP and MySQL queries...

2001-10-25 Thread Steve Cayford

Oop. I guess I missed the point of that question. Still, the MySQL 
manual says a DATE takes 3 bytes, DATETIME 8 bytes, and TIMESTAMP 4 
bytes. That seems fairly efficient. Using an INT for a date might 
actually take up more space.

-Steve

On Thursday, October 25, 2001, at 09:34  AM, Steve Cayford wrote:

 Yep, MySQL has DATE, DATETIME, and TIMESTAMP field types. You can order 
 by them and everything.

 -Steve

 On Thursday, October 25, 2001, at 09:18  AM, Tim Foster wrote:

 I'm new to this list, to PHP and to MySQL (been doing VBScript on ASP 
 for several years,
 tho).

 I'm curious...

 If you're going to store it as an integer, why not store 10/24/2001 
 as MMDD
 (20011024). This gives you the added benefit of being able to have the 
 db sort your
 fields. This even works if you want to include the time with your date 
 (provided all dates
 in the field consistently contain the same *amount* of info). For 
 example, noon on
 Christmas will always be lower than noon of the following New Year 
 ..as it should be:

 /MM/DD   20011225 20020101
 /MM/DD HH:MM 200112251200 200201011200
 /MM/DD HH:MM:SS  2001122512   2002010112

 I'm betting there's no easy way to sort it if you store it as MM/DD/YY

 MM/DD/   10242001  12252001 (good)
 ..but NOT less than the following New Year's
 MM/DD/   10242001  01012002 (bad)

 Granted, you might take up a bit more space in the DB, which would 
 have a tiny impact on
 performance(??), but an extra $100 on the hard drive would effectively 
 eliminate any
 reasonable space considerations and (IMHO) reduce the amount of 
 programming/debugging to
 more than justify the overhead.

 FWIW, M$ likes to store their dates as two integers: one to hold the 
 date portion, the
 other to hold the hours:minutes:seconds portion.

 If there's something about PHP/MySQL that makes this point moot, 
 please let me know.

 TIM
 -He who always plows a straight furrow is in a rut.


 -Original Message-
 From: Mike Frazer [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 24, 2001 7:54 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] PHP and MySQL queries...


 Agreed.  This is especially useful when you need to conserve every 
 byte you
 can; a timestamp of 10/24/2001 or something similar is going to 
 take 10
 bytes as a string and an indeterminate number of bytes for an actual
 timestamp because of system variations, whereas an integer value of 
 10242001
 will take you 2-4 bytes depending on the type of int you declare.  
 Not a lot
 of space, but assume for a second you have 30 fields in your database 
 and 5
 million rows...suddenly those 6-8 bytes have multiplied on this one 
 field
 alone.  Space and speed are important in DBs :)

 Mike Frazer


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: php-list-
 [EMAIL PROTECTED]



 -- PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...

2001-10-25 Thread Robinson, Mike
Title: RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...





http://mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_types


Mysql permits all manner of formats for date/time storage,
and a whole slew of functions for retrieving date/time
info in useful, meaningful ways.


For me, parsing date/time stuff before an insert or after a
select is just plain bad practice, IMHO, when the data can go
in and out in the format required without parsing, particularly
with resource-costly tools like regex and the like.


Date/time select controls (I think there's some on devshed
and/or Zend) and mysql's built-in date/time functions rock.



Mike Robinson
IT / Developer - Toronto Star TV
Phone: 416.945.8786
Fax: 416.869.4566
Email: [EMAIL PROTECTED]



Tim Foster wrote:


 If there's something about PHP/MySQL that makes this point 
 moot, please let me know.




http://www.torontostartv.com - Webcasting  Production
http://www.tmgtv.ca - Hometown Television
http://www.thestar.com - Canada’s largest daily newspaper, The Toronto Star, online



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...

2001-10-25 Thread Chris Newbill

-Original Message-
From: Tim Foster [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 25, 2001 8:19 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...


snip... (been doing VBScript on ASP for several years,
tho).

I feel sorry for you. :)

I'm curious...

If you're going to store it as an integer, why not store 10/24/2001 as
MMDD
(20011024). This gives you the added benefit of being able to have the db
sort your
fields. This even works if you want to include the time with your date
(provided all dates
in the field consistently contain the same *amount* of info). For example,
noon on
Christmas will always be lower than noon of the following New Year ..as it
should be:

/MM/DD 20011225 20020101
/MM/DD HH:MM   200112251200 200201011200
/MM/DD HH:MM:SS2001122512   2002010112

A better way to do integer date is a UNIX timestamp.  This will sort just as
easy as the method above.

By looking at the date() function you should be able to see immediately the
benefit in ease-of-use (not to mention portability in the DB) and formating
options available for the timestamp.

http://www.php.net/date

-Chris


 -Original Message-
 From: Mike Frazer [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 24, 2001 7:54 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] PHP and MySQL queries...


 Agreed.  This is especially useful when you need to conserve every byte
you
 can; a timestamp of 10/24/2001 or something similar is going to take 10
 bytes as a string and an indeterminate number of bytes for an actual
 timestamp because of system variations, whereas an integer value of
10242001
 will take you 2-4 bytes depending on the type of int you declare.  Not a
lot
 of space, but assume for a second you have 30 fields in your database and
5
 million rows...suddenly those 6-8 bytes have multiplied on this one field
 alone.  Space and speed are important in DBs :)

 Mike Frazer


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...

2001-10-25 Thread Tim Foster

 From: Chris Newbill [mailto:[EMAIL PROTECTED]]

 snip... (been doing VBScript on ASP for several years, tho).

 I feel sorry for you. :)

;) Never fear. It works, does what it needs to do (so long as it's properly patched ;) 
and
I make a fist-full of money for moon-lighting. Can't complain too loudly, eh?


 If you're going to store it as an integer, why not store 10/24/2001
 as MMDD
 A better way to do integer date is a UNIX timestamp.  This will sort just as
 easy as the method above.

 By looking at the date() function you should be able to see immediately the
 benefit in ease-of-use (not to mention portability in the DB) and formating
 options available for the timestamp.

 http://www.php.net/date

 -Chris

Don't get me wrong.. I'm quite comfortable with manipulating dates (well.. as far as M$
goes), and I fully intend to continue using DATE fields and functions to handle my date
needs. I'm too lazy to re-invent the wheel.

The crux of my question was aimed only at those who didn't want to use DATE fields and
would rather use int fields instead. I wanted to make sure I wasn't missing some cool
feature of PHP.  ..and the feedback I'm getting indicates that my general 
understanding of
dates in ASP is not too different with PHP.

TIM
-Things are more like they are today than they ever have been before.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP and MySQL queries...

2001-10-24 Thread Russ Michell

How about using 3 select menus:

* One for the day called 'dayselect'
* One for the month called 'monthselect;
* One for the year called 'yearselect'

When you get the values from the selects to perform query's upon, re-arrange the order 
the dates 
come in:

In your form they'll be in the order: day,month,year
To perform queries into a MySQL DB re-arrange them:

$date = $yearselect . - . $monthselect . - . $yearselect;

HTH
Russ

On Tue, 23 Oct 2001 10:52:41 -0600 Jason [EMAIL PROTECTED] wrote:

 I am having a hard time setting up a form for users to enter a date in the
 format of 00/00/ (of course they would use an actual date).  My form is
 as follows...
 form name=auth method=post action=search.php
   p*I.E. - Format is 04/01/2001*/p
   pSearch for Ads by date:
 input type=text name=date
   /p
   p
 input type=submit name=login
 value=Submit
 input type=reset name=reset value=Reset
   /p
 /form
 
 On my search.php page I have the following MySQL connection and search
 parameters...
 ?php
 
 mysql_connect (db_hostname, db_username, db_password);
 
 mysql_select_db (db_name);
 
 if ($date == )
 {$date = '%';}
 
 $result = mysql_query (SELECT
 fname,lname,address,city,state,zip,phonea,phone,email,crty,crnum,crmo,cryr,w
 eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time
   FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 );
 $count = -1;
 if ($row = mysql_fetch_array($result)) {
 $count ++;
 do {
 echo BName: /B;
 printf(mysql_result($result,$count,fname));
 echo  ;
 printf(mysql_result($result,$count,lname));
 echo BR\n;
 
 echo BAddress: /B;
 printf(mysql_result($result,$count,address));
 echo BR\n;
 
 echo BCity: /B;
 printf(mysql_result($result,$count,city));
 echo BR\n;
 
 echo BState: /B;
 printf(mysql_result($result,$count,state));
 echo BR\n;
 
 echo BZip: /B;
 printf(mysql_result($result,$count,zip));
 echo BR\n;
 
 echo BPhone: /B(;
 printf(mysql_result($result,$count,phonea));
 echo ) ;
 printf(mysql_result($result,$count,phone));
 echo BR\n;
 
 echo BEmail: /B;
 printf(mysql_result($result,$count,email));
 echo BR\n;
 
 echo BCredit Type: /B;
 printf(mysql_result($result,$count,crty));
 echo BR\n;
 
 echo BCredit Number: /B;
 printf(mysql_result($result,$count,crnum));
 echo BR\n;
 
 echo BCredit Card Date: /B;
 printf(mysql_result($result,$count,crmo));
 echo  ;
 printf(mysql_result($result,$count,cryr));
 echo BR\n;
 
 echo BWeeks: /B;
 printf(mysql_result($result,$count,weeks));
 echo BR\n;
 
 echo Btown1: /B;
 printf(mysql_result($result,$count,town1));
 echo BR\n;
 
 echo Btown2: /B;
 printf(mysql_result($result,$count,town2));
 echo BR\n;
 
 echo Btown3: /B;
 printf(mysql_result($result,$count,town3));
 echo BR\n;
 
 echo BIP Address: /B;
 printf(mysql_result($result,$count,ipaddress));
 echo BR\n;
 
 echo BAd: /B;
 
 $ad[$count] = (mysql_result($result,$count,ad));
 
 $ad[$count] = ereg_replace (a, ', $ad[$count]);
 $ad[$count] = ereg_replace (q, \, $ad[$count]);
 $ad[$count] = ereg_replace (p, %, $ad[$count]);
 $ad[$count] = ereg_replace (bs, \\, $ad[$count]);
 
 
 echo $ad[$count];
 echo BR\n;
 
 echo BTotal: /B;
 printf(mysql_result($result,$count,total));
 echo BR\n;
 
 echo BAd Number: /B;
 printf(mysql_result($result,$count,num));
 echo BR\n;
 
 echo BDate: /B;
 printf(mysql_result($result,$count,date));
 echo BR\n;
 
 echo BTime: /B;
 printf(mysql_result($result,$count,time));
 echo BR\n;
 
 } while($row = mysql_fetch_array($result));
 
 } else {print Sorry, no records were found!;}
 
 ?
 So far I have come to the conclusion that the input from the user is
 probably where my problem is because I am assuming it is taking the / in
 the date they enter and doing something I don't want it to.  In any event if
 someone could give me a clue as to how to resolve this issue it would be
 greatly appreciated.
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...

2001-10-24 Thread Robinson, Mike
Title: RE: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...





In these days and times, conservation of a meg of disk
space is really not a consideration. Not the primary one anyway.
The data should be stored in a format such that the
storage itself and then retrieval can be executed with a
minimum of handling/intervention other than the required
sanity-checking.


I've found that a set of date/time select controls and storage
in a datetime field have been optimal. Insertion requires
no parsing or complex handling (just some gluing of array
elements) and retrieval with mysql's date-related functions
means I don't need to touch the data one bit to display
it in a meaningful way.


For me, having to parse information before insertion,
or after retrieval in order to display it, wastes far
more resources than storing dates in a format other than
an int.



Mike Robinson
IT / Developer - Toronto Star TV
Phone: 416.945.8786
Fax: 416.869.4566
Email: [EMAIL PROTECTED]



 -Original Message-
 From: Mike Frazer [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 24, 2001 8:54 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...
 
 
 Agreed. This is especially useful when you need to conserve 
 every byte you
 can; a timestamp of 10/24/2001 or something similar is 
 going to take 10
 bytes as a string and an indeterminate number of bytes for an actual
 timestamp because of system variations, whereas an integer 
 value of 10242001
 will take you 2-4 bytes depending on the type of int you 
 declare. Not a lot
 of space, but assume for a second you have 30 fields in your 
 database and 5
 million rows...suddenly those 6-8 bytes have multiplied on 
 this one field
 alone. Space and speed are important in DBs :)
 
 Mike Frazer





http://www.torontostartv.com - Webcasting  Production
http://www.tmgtv.ca - Hometown Television
http://www.thestar.com - Canada’s largest daily newspaper, The Toronto Star, online



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP-DB] Php and Mysql: Aborted connection to mySQL with PHP4

2001-07-11 Thread Andreas Persson

I'm using Php 4.0.1 pl2-9 and Mysql 3.23.22 and gets the following error in
Mysqls logfile:
010711 10:58:52  Aborted connection 381 to db: 'improvement' user: 'webusr'
host: `web.local' (Got an error reading communication packets)

After a while mysql doesn't accept more connection because it has reached
the maximum connection error and i must do a host-flush.

The problem only appears when I run php on the same server, when I run php
from my windows machine (later version of php) against the
same database i dont get the error.

Is is a bug so i shall upgrade php or is it a miss configuration done by me?

/Andreas



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP accessing MySQL

2001-05-22 Thread Jonathan Duncan

That is what I thought, so I set $db_num to another number and still came up
with the same error.

jkd


Darren [EMAIL PROTECTED] wrote in message
9e42lj$s7b$[EMAIL PROTECTED]">news:9e42lj$s7b$[EMAIL PROTECTED]...
 I think the 0 is referring to your $db_num
 Jonathan Duncan [EMAIL PROTECTED] wrote in message
 9e3suq$17r$[EMAIL PROTECTED]">news:9e3suq$17r$[EMAIL PROTECTED]...
  I am making a script to access MySQL and when I run it I get this:
 
  Warning: 0 is not a MySQL link index in
 /sites/htdocs/php/db_listtables.php
  on line 10
 
  Following is the first 10 lines of my script:
 
  ?
$connection = mysql_connect(localhost, user, password) or
  die(Couldn't connect.);
$dbs = mysql_list_dbs($connection) or die(Couldn't list databases.);
$db_list = UL;
$db_num = 0;
while ($db_num  mysql_num_rows($dbs)) {
  $db_names[$db_num] = mysql_tablename($dbs, $db_num);
   $db_list .= LI$db_names[$db_num];
   if (($db_names[$db_num] != mysql)  ($db_names[$db_num] !=
 tempdata))
  {
 $tables = mysql_list_dbs($db_names[$db_num]) or die(Couldn't list
  databases.);
 
  Any Ideas?  Thank you in advance!!
 
  Jonathan
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP accessing MySQL

2001-05-22 Thread Jonathan Duncan


Miles Thompson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jonathan .. see below.
 At 08:38 PM 5/18/01 +, Jonathan Duncan wrote:
 Miles
 
 Thank you for the response.  I did some debugging and the value of $dbs
is 2.
 
 I am not sure of what example you are referring to.  I am not using the
 manual currently, although I have the PDF version of it.

 http://www.php.net/mysql_list_dbs
 for on line version, with annotations!

I tried the example found on the site:

  while ($row = mysql_fetch_object($dbs)) {
echo $row-Database . \n;
  }

And the results were null.  It listed nothing.  I have a question about this
example, what is the - supposed to do?



 The incrementation of $db_num happens on line 24 but I only listed the
first
 10 lines because it seems to be a problem within the first 10 lines as
the
 error message indicates.
 
 If I change line 10 from:
 
 $tables = mysql_list_dbs($db_names[$db_num])
 
 to:
 
 $tables = mysql_list_dbs()
 
 the script runs and gives me a list of the databases redundantly:
 
 -mysql
 -test
 mysql
 test
 twignud
 -twignud
 mysql
 test
 twignud

 Cool! Although it's not what you want. g.
 But what is it telling us? We're just running through two loops, but
really
 asking for the same information each time, if I interpret it correctly.

 And if you look at your code, you have two nested loops, doing essentially
 the same thing - listing the databases.

That is pretty much what I am trying to do.  I want to list each database
and then the tables within those databases.


 ?
$connection = mysql_connect(localhost, user, password) or die
 (Couldn't connect.);
$dbs = mysql_list_dbs($connection) or die(Couldn't list databases.);
$db_list = UL;
$db_num = 0;
while ($db_num  mysql_num_rows($dbs)) {
  $db_names[$db_num] = mysql_tablename($dbs, $db_num);
  $db_list .= LI$db_names[$db_num];
  if (($db_names[$db_num] != mysql)  ($db_names[$db_num] !
 = tempdata)) {
  $tables = mysql_list_dbs($db_names[$db_num]) or die(Couldn't
list
 databases.);
$tables = mysql_list_dbs() or die(Couldn't list databases.);
$table_list = UL;
$table_num = 0;
while ($table_num  mysql_num_rows($tables)) {
  $table_names[$table_num] = mysql_tablename($tables,
$table_num);
  $table_list .= LI$table_names[$table_num];
  $table_num++;
}
$table_list .= /UL;
  }
  $db_list .= $table_list;
  $db_num++;
}
$db_list .= /UL;
 ?
 
 This is minus my debugging additions.  I tried to get info from
 $mysql_tablename but it came up blank every way I tried it.  It is as
though
 nothing is getting passed into $mysql_tablename.

 That's strange, because this annotation came from zak@php:
 [Editor's Note: mysql_db_name(), mysql_dbname() and mysql_tablename()
   are all aliases for mysql_result() and should behave in exactly the same
   fashion. [EMAIL PROTECTED]]

 Use mysql_db_name() instead of mysql_tablename() to read databases.
 http://php.net/manual/en/function.mysql-db-name.php

 So this should give us a list of keys and databases:
 while( $row = mysql_fetch_array( $dbs ) )
 {
  echo $row[ 0 ];
  echo $row[ 1 ];
 }


while($row = mysql_fetch_array($dbs)) {
echo Row 0 is , $row[0];
 echo Row 1 is , $row[1];
  }

Returns:

Row 0 is mysqlRow 1 is Row 0 is testRow 1 is Row 0 is twignudRow 1 is

-IE-

Row 0 is mysql
Row 1 is
Row 0 is test
Row 1 is
Row 0 is twignud
Row 1 is

 I'm wondering, if $row[ 0 ] returns the name of the database, and $row[
1 ]
 returns array. (Or vice versa.) If so, we should be able to nest another
 while () in there and fetch the table names. (If that's your intention.)

 I'll warn you that I get lost in multi-dimensional arrays very quickly,
and
 I'm freelancing this off the top of my head.

It seems that Row 1 doesn't have anything which may be the source of the
problem.  What do you think of this?


 Does this clarify anything in your mind?  I am taking this script
straight
 from a book.  However, the book is designed for PHP 4 and I am using PHP
 3.0.16, although I don't know if that would make a difference.

 Shouldn't, but is there any reason why you can't go to 4.0.5? Why not get
 the database names loop working first, and then go for the table names, a
 divide and conquer approach.

Sounds like a good plan, I will see what I can do.


 Thank you very much for your help,
 Jonathan

 My pleasure - you're digging on it too.
 Miles

Yep, I love this stuff!



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP accessing MySQL

2001-05-22 Thread Julie Meloni

I believe you want to look at this page:
http://www.thickbook.com/books/phpfe_errata.phtml



-- 
++
| Julie Meloni ([EMAIL PROTECTED]) |
||
| PHP Essentials and PHP Fast  Easy |
|   http://www.thickbook.com |
++


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP accessing MySQL

2001-05-22 Thread Jonathan Duncan

YES!!  I just had a feeling the book was wrong.  That did get rid of the
error.  However, it did not completely solve my issue.  Now when I run the
script I just get the message Couldn't list databases.  This just happens
to be the die message for the same line of code that I have been looking at:

   $tables = mysql_list_tables($db_names[$db_num]) or die(Couldn't list
databases.);

It is almost as if it is not being able to even list the tables from the
databases.  I am working right now on just listing the tables of a database
to see what happens.

Thank you,
jkd


Julie Meloni [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I believe you want to look at this page:
 http://www.thickbook.com/books/phpfe_errata.phtml



 --
 ++
 | Julie Meloni ([EMAIL PROTECTED]) |
 ||
 | PHP Essentials and PHP Fast  Easy |
 |   http://www.thickbook.com |
 ++


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP accessing MySQL

2001-05-18 Thread Darren

I think the 0 is referring to your $db_num
Jonathan Duncan [EMAIL PROTECTED] wrote in message
9e3suq$17r$[EMAIL PROTECTED]">news:9e3suq$17r$[EMAIL PROTECTED]...
 I am making a script to access MySQL and when I run it I get this:

 Warning: 0 is not a MySQL link index in
/sites/htdocs/php/db_listtables.php
 on line 10

 Following is the first 10 lines of my script:

 ?
   $connection = mysql_connect(localhost, user, password) or
 die(Couldn't connect.);
   $dbs = mysql_list_dbs($connection) or die(Couldn't list databases.);
   $db_list = UL;
   $db_num = 0;
   while ($db_num  mysql_num_rows($dbs)) {
 $db_names[$db_num] = mysql_tablename($dbs, $db_num);
  $db_list .= LI$db_names[$db_num];
  if (($db_names[$db_num] != mysql)  ($db_names[$db_num] !=
tempdata))
 {
$tables = mysql_list_dbs($db_names[$db_num]) or die(Couldn't list
 databases.);

 Any Ideas?  Thank you in advance!!

 Jonathan



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP accessing MySQL

2001-05-18 Thread Miles Thompson

Jonathan .. see below.
At 08:38 PM 5/18/01 +, Jonathan Duncan wrote:
Miles

Thank you for the response.  I did some debugging and the value of $dbs is 2.

I am not sure of what example you are referring to.  I am not using the
manual currently, although I have the PDF version of it.

http://www.php.net/mysql_list_dbs
for on line version, with annotations!


The incrementation of $db_num happens on line 24 but I only listed the first
10 lines because it seems to be a problem within the first 10 lines as the
error message indicates.

If I change line 10 from:

$tables = mysql_list_dbs($db_names[$db_num])

to:

$tables = mysql_list_dbs()

the script runs and gives me a list of the databases redundantly:

-mysql
-test
mysql
test
twignud
-twignud
mysql
test
twignud

Cool! Although it's not what you want. g.
But what is it telling us? We're just running through two loops, but really 
asking for the same information each time, if I interpret it correctly.

And if you look at your code, you have two nested loops, doing essentially 
the same thing - listing the databases.


?
   $connection = mysql_connect(localhost, user, password) or die
(Couldn't connect.);
   $dbs = mysql_list_dbs($connection) or die(Couldn't list databases.);
   $db_list = UL;
   $db_num = 0;
   while ($db_num  mysql_num_rows($dbs)) {
 $db_names[$db_num] = mysql_tablename($dbs, $db_num);
 $db_list .= LI$db_names[$db_num];
 if (($db_names[$db_num] != mysql)  ($db_names[$db_num] !
= tempdata)) {
 $tables = mysql_list_dbs($db_names[$db_num]) or die(Couldn't list
databases.);
   $tables = mysql_list_dbs() or die(Couldn't list databases.);
   $table_list = UL;
   $table_num = 0;
   while ($table_num  mysql_num_rows($tables)) {
 $table_names[$table_num] = mysql_tablename($tables, $table_num);
 $table_list .= LI$table_names[$table_num];
 $table_num++;
   }
   $table_list .= /UL;
 }
 $db_list .= $table_list;
 $db_num++;
   }
   $db_list .= /UL;
?

This is minus my debugging additions.  I tried to get info from
$mysql_tablename but it came up blank every way I tried it.  It is as though
nothing is getting passed into $mysql_tablename.

That's strange, because this annotation came from zak@php:
[Editor's Note: mysql_db_name(), mysql_dbname() and mysql_tablename()
  are all aliases for mysql_result() and should behave in exactly the same
  fashion. [EMAIL PROTECTED]]

Use mysql_db_name() instead of mysql_tablename() to read databases.
http://php.net/manual/en/function.mysql-db-name.php

So this should give us a list of keys and databases:
while( $row = mysql_fetch_array( $dbs ) )
{
 echo $row[ 0 ];
 echo $row[ 1 ];
}

I'm wondering, if $row[ 0 ] returns the name of the database, and $row[ 1 ] 
returns array. (Or vice versa.) If so, we should be able to nest another 
while () in there and fetch the table names. (If that's your intention.)

I'll warn you that I get lost in multi-dimensional arrays very quickly, and 
I'm freelancing this off the top of my head.

Does this clarify anything in your mind?  I am taking this script straight
from a book.  However, the book is designed for PHP 4 and I am using PHP
3.0.16, although I don't know if that would make a difference.

Shouldn't, but is there any reason why you can't go to 4.0.5? Why not get 
the database names loop working first, and then go for the table names, a 
divide and conquer approach.


Thank you very much for your help,
Jonathan

My pleasure - you're digging on it too.
Miles



Miles Thompson [EMAIL PROTECTED] said:

  Well, when you debug it, what do you get?
  What's  the value of $dbs?
 
  Did you try the simple example shown in the manual, using your 
 information.
  Did it work?
 
  I don't see where you are incrementing $db_num, that could be where your
  error is coming from. Also check to see if what you are getting back from
  mysql_tablename() is text or and index.
 
  Good luck - Miles Thompson
 
  At 01:33 PM 5/18/01 -0600, you wrote:
  I am making a script to access MySQL and when I run it I get this:
  
  Warning: 0 is not a MySQL link index in 
 /sites/htdocs/php/db_listtables.php
  on line 10
  
  Following is the first 10 lines of my script:
  
  ?
 $connection = mysql_connect(localhost, user, password) or
  die(Couldn't connect.);
 $dbs = mysql_list_dbs($connection) or die(Couldn't list databases.);
 $db_list = UL;
 $db_num = 0;
 while ($db_num  mysql_num_rows($dbs)) {
   $db_names[$db_num] = mysql_tablename($dbs, $db_num);
$db_list .= LI$db_names[$db_num];
if (($db_names[$db_num] != mysql)  ($db_names[$db_num] !
= tempdata))
  {
  $tables = mysql_list_dbs($db_names[$db_num]) or die(Couldn't list
  databases.);
  
  Any Ideas?  Thank you in advance!!
  
  Jonathan
  
  
  
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: 

[PHP-DB] PHP and MySQL

2001-04-19 Thread Mike Corredea

I just downloaded MySQL-3.23.36.tar (Which is the Source tar) from their
site and I have php-4.0.4pl1. I have installed MySQL and it is ready to
go. I know this for I can connect via the MySQL Monitor. When I try to
configure php with the line "./configure
--with-apache=/usr/local/apache_1.3.19 --with-mysql --with-ldap
--enable-track-vars" it tells me that it can't find the header files.
Then I point it to the header files, after that I get the error "can't
find client lib". What should I do about this ?? Where do I tell php to
look for it ??


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP and MySQL

2001-04-19 Thread olinux

try the tutorial at www.thickbook.com or at www.devshed.com for setting
everything up.

olinux

- Original Message -
From: "Mike Corredea" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 10:02 AM
Subject: [PHP-DB] PHP and MySQL


 I just downloaded MySQL-3.23.36.tar (Which is the Source tar) from their
 site and I have php-4.0.4pl1. I have installed MySQL and it is ready to
 go. I know this for I can connect via the MySQL Monitor. When I try to
 configure php with the line "./configure
 --with-apache=/usr/local/apache_1.3.19 --with-mysql --with-ldap
 --enable-track-vars" it tells me that it can't find the header files.
 Then I point it to the header files, after that I get the error "can't
 find client lib". What should I do about this ?? Where do I tell php to
 look for it ??


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] php with mysql or interebase?

2001-04-17 Thread Doug Semig

[In a deadpan voice...] Oh, what a fascinating twist.  

http://marc.theaimsgroup.com/?l=php-db is where this particular list is
archived.

That's where you can learn a lot about the individual programs, and you may
find out little bits of wisdom like:  each database has strengths and
weaknesses, you really should pick the platform based upon your needs, even
the best database will not help you if you start with a poorly designed
schema.

Doug

At 02:33 PM 4/17/01 -0400, [EMAIL PROTECTED] wrote:
I'm trying to decide whether to use interbase or mysql with php.
Both are free and both have a php api.

So with is better to use with php?
Or does it matter?

[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] php with mysql - multiple tables

2001-04-15 Thread Shahmat Dahlan

I have three tables, whereby I have used a select statement to extract
some of the fields from each and one of the tables.

e.g.
$sqlstmt ="SELECT stock_in.id, equip.equip_type, equip.brand,
equip.model, vendor.name ";
$sqlstmt.="FROM stock_in,equip,vendor ";
$sqlstmt.="WHERE equip.id=equip_id and vendor.id=vendor_id and
equip.equip_type='Network Server'";

$result=mysql_query($sqlstmt);

I know the $sqlstmt query does work. But if I do a mysql_fetch_array and
assign it to a variable called $myrow,

while ($myrow=mysql_fetch_array($result)) {
   ...
}

how do I display the content array $myrow? When I do a,

printf("%snbsp;", $myrow["equip.equip_type"]);

nothing is visible.

Help?

Thanks in advance.

Shahmat



Re: [PHP-DB] php with mysql - multiple tables

2001-04-15 Thread Shahmat Dahlan

printf("%snbsp;", $myrow["equip_type"]); //no table name
did  not work, and did not display the content

But if I apply the extract on $myrow, it worked..
extract($myrow);
printf("%snbsp;", $equip_type);

Thanks

regards


CC Zona wrote:

 In article [EMAIL PROTECTED],
  [EMAIL PROTECTED] ("Shahmat Dahlan") wrote:

  $result=mysql_query($sqlstmt);
 
  I know the $sqlstmt query does work. But if I do a mysql_fetch_array and
  assign it to a variable called $myrow,
 
  while ($myrow=mysql_fetch_array($result)) {
 ...
  }
 
  how do I display the content array $myrow? When I do a,
 
  printf("%snbsp;", $myrow["equip.equip_type"]);
 
  nothing is visible.

 $result=mysql_query($sqlstmt) or die("Oops! MySQL error: " .
 mysql_error()); //"know" the query is valid

 if(mysql_num_rows($result)) //"know" the query gave you something to fetch
{
while ($myrow=mysql_fetch_array($result))
   {
   ...
   }
}

 Where "..." is:

printf("%snbsp;", $myrow["equip_type"]); //no table name

 or:

extract($myrow);
printf("%snbsp;", $equip_type); //no table name and easier to read ;-)

 --
 CC

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP an MySQL

2001-04-02 Thread Russ Michell

I have read and have reccommended several times: "PHP Fast and Easy Web 
Development" By Juli C Meloni.



ISBN: 0-7615-3055-X
Prima Tech publishing

#---#

 "Believe nothing - consider everything"

  Russ Michell
  Anglia Polytechnic University Webteam
  http://gertrude.sipu.anglia.ac.uk/webteam
  [EMAIL PROTECTED]
  +44 (0)1223 363271 ext 2331
  
  www.theruss.com

#---#


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PHP an MySQL

2001-04-01 Thread Jim Ray

Can someone recommend a book that shows how to use PHP and MySQL.

 I need to see how to pass parms from a form to a PHP so I can Update, Add
and Delete records.

Thanks for the help.

Jim Ray



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] PHP an MySQL

2001-04-01 Thread Jeff Oien

I would recommend the first two books listed on this page:
http://www.webdesigns1.com/php/books.php
I've read both.
Jeff Oien

 Can someone recommend a book that shows how to use PHP and MySQL.
 
  I need to see how to pass parms from a form to a PHP so I can Update, Add
 and Delete records.
 
 Thanks for the help.
 
 Jim Ray
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP and MySQL

2001-03-15 Thread Romeo Manzur

hi, you could do it in a easier way, first put real names for the fields in your
form:
div align="left"login :
   input type="text" name="login"
/div
br

div align="left"group :
   input type="text" name="group"
/div
br

div align="left"password :
   input type="text" name="pasword"
/div
, second you could do this:
INSERT INTO $table_name (id, login, group, password) VALUES ('', '$login',
$group', '$password')
try this...

luck...

Vanstaen Laurent wrote:

 Hi all,
I have a few questions about PHP and databases :

 - how do you insert a character string into a database when it is stored in an
 array ? For example I have the name of a person in an array called "$name" and
 when I insert it into the field "name" in my table, I get a field with "array"
 written in it.

 - I have a form, where users fill in several pieces of information (login,
 forename, lastname, age, etc ...). When I submit the form, I get the following
 error : "Unknown column 'foo' in 'field list' " where foo is the information
 that was typed in the form in the field login for example. Has anyone
 encountered such problem before ??

 Laurent Vanstaen

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Romeo Manzur
Web Application Developer
iSilicom
Av. 27 de Febrero 904 Altos
Despacho 1, Centro
Villahermosa, Tabasco, Mexico
Tel: (52)(9)3-12-4790



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP and MySQL

2001-03-14 Thread Vanstaen Laurent

Hi,
   my exact problem is the following. Here is my form :
 
div align="left"login :
   input type="text" name="field[0]"
/div
br
 
div align="left"group :
   input type="text" name="field[1]"
/div
br
 
div align="left"password :
   input type="text" name="field[2]"
/div
   
when I put the data in the table, I get either "field[i]" or array.
I can't use more specific names than field[$i] bacause I get the name of the 
fiels directly from my table (so my script enables to update any table without 
knowing how it is written).

Laurent
  

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP and MYSQL query

2001-03-10 Thread David Balatero

First, try just calling the form action like:

form action="luquery.php?DB=csjoaTA=associatesSortField=company"
method="POST"
Turning the amp; into  chars (maybe my mail prog formatted it like this?
...nevertheless..)

Also, try doing:

$result=mysql_query("select * from $TA where $SortField='%".$search."%'
order by $SortField");

---
David Balatero
www.icegaming.com
[EMAIL PROTECTED]
---

Jim Ray wrote:

 I have a simpe query that I can not seem to get to work.

 Here is the HTML side:
 td width="27%" align="center"form
 action="luquery.php?DB=csjoaamp;TA=associatesamp;SortField=company"
 method="post"input type="text" name="search"brinput
 type="submit"/form/td

 Here is the PHP side:

 The fields are being past, but I get 0 in the results?

 $result=mysql_query("select * from $TA where $SortField='$search%' order
 by $SortField");

 Am I missing something here?

 Thanks for the help.

 Jim

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] php and mysql file insertion!

2001-03-06 Thread Rick Emery

http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1825

-Original Message-
From: Kevin Connolly [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 06, 2001 12:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] php and mysql file insertion!


Hi,
I have a MySQL database that is updated using a PHP script. It stores a
members details (name, address etc.) I also want it to store a file (a
member photo to be exact). Is this possible?
Any help is much appreciated!
Thanks,
Kevin.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >