Re: [PHP-DB] PHP and MYSQL Update problem
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
Re: [PHP-DB] PHP and MYSQL Update problem
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 wrote: > 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
[PHP-DB] PHP and MYSQL Update problem
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 image script
Look at www.phpclasses.org ;) Wilson Osemeilu napsal(a): I need a simple php mysql image upload script with display script too and to make this easier the mysql database table to use -- S pozdravem Daniel Tlach Freelance webdeveloper Email: m...@danaketh.com ICQ: 160914875 MSN: danak...@hotmail.com Jabber: danak...@jabbim.cz
Re: [PHP-DB] php and mysql image script
On Thu, May 28, 2009 at 4:19 PM, Wilson Osemeilu wrote: > 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
[PHP-DB] php and mysql image script
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 design question
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
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
> 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
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
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
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
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 design question
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
[PHP-DB] PHP and MySQL design question
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
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
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
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
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
Re: [PHP-DB] PHP and MYSQL
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? -- 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
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
[PHP-DB] PHP and MYSQL
Can PHP 4 work with MYSQL 5?
Re: [PHP-DB] PHP and MySQL on Windows causing severe slowdown
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
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 and Mysql help
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
Re: [PHP-DB] PHP and Mysql help
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("Error performing query: " . mysql_error() . ""); exit(); } while ( $row = mysql_fetch_array($zipcode) ) { echo("City: " . $row["ZG_CITY"]. ""); echo("State: " . $row["ZG_STATE"]. ""); echo("Zip Code: " . $row["ZG_ZIPCODE"]. ""); echo("Area Code: " . $row["ZG_AREACODE"]. ""); echo("County FIPS: " . $row["ZG_COUNTY_FIPS"]. ""); echo("County Name: " . $row["ZG_COUNTY_NAME"]. ""); echo("Time Zone: " . $row["ZG_TIME_ZONE"]. ""); echo("Day Light Savings?: " . $row["ZG_DST"]. ""); echo("Latitude: " . $row["ZG_LATITUDE"]. ""); echo("Longitude: " . $row["ZG_LONGITUDE"]. ""); } 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?
[PHP-DB] PHP and Mysql help
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("Error performing query: " . mysql_error() . ""); exit(); } while ( $row = mysql_fetch_array($zipcode) ) { echo("City: " . $row["ZG_CITY"]. ""); echo("State: " . $row["ZG_STATE"]. ""); echo("Zip Code: " . $row["ZG_ZIPCODE"]. ""); echo("Area Code: " . $row["ZG_AREACODE"]. ""); echo("County FIPS: " . $row["ZG_COUNTY_FIPS"]. ""); echo("County Name: " . $row["ZG_COUNTY_NAME"]. ""); echo("Time Zone: " . $row["ZG_TIME_ZONE"]. ""); echo("Day Light Savings?: " . $row["ZG_DST"]. ""); echo("Latitude: " . $row["ZG_LATITUDE"]. ""); echo("Longitude: " . $row["ZG_LONGITUDE"]. ""); } 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 question
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("Error performing query: " . mysql_error() . ""); exit(); } while ( $row = mysql_fetch_array($zipcode) ) { echo("City: " . $row["ZG_CITY"]. ""); echo("State: " . $row["ZG_STATE"]. ""); echo("Zip Code: " . $row["ZG_ZIPCODE"]. ""); echo("Area Code: " . $row["ZG_AREACODE"]. ""); echo("County FIPS: " . $row["ZG_COUNTY_FIPS"]. ""); echo("County Name: " . $row["ZG_COUNTY_NAME"]. ""); echo("Time Zone: " . $row["ZG_TIME_ZONE"]. ""); echo("Day Light Savings?: " . $row["ZG_DST"]. ""); echo("Latitude: " . $row["ZG_LATITUDE"]. ""); echo("Longitude: " . $row["ZG_LONGITUDE"]. ""); } 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: Error performing query: " . mysql_error() . ""); exit(); } $Lat2 = mysql_query( "SELECT (ZG_LATITUDE+2) FROM zip_code where zg_zipcode = '$zip'"); if (!$Lat2) { echo("Error performing query: " . mysql_error() . ""); exit(); } $Lon1 = mysql_query( "SELECT (ZG_LONGITUDE-2) FROM zip_code where zg_zipcode = '$zip'"); if (!$Lon1) { echo("Error performing query: " . mysql_error() . ""); exit(); } $Lon2 = mysql_query( "SELECT (ZG_LONGITUDE+2) FROM zip_code where zg_zipcode = '$zip'"); if (!$Lon2) { echo("Error performing query: " . mysql_error() . ""); 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("Error performing query: " . mysql_error() . ""); exit(); } while ( $row = mysql_fetch_array($ZipCode) ) { echo("City: " . $row["ZG_CITY"]. ""); echo("State: " . $row["ZG_STATE"]. ""); echo("Zip Code: " . $row["ZG_ZIPCODE"]. ""); echo("Area Code: " . $row["ZG_AREACODE"]. ""); echo("County FIPS: " . $row["ZG_COUNTY_FIPS"]. ""); echo("County Name: " . $row["ZG_COUNTY_NAME"]. ""); echo("Time Zone: " . $row["ZG_TIME_ZONE"]. ""); echo("Day Light Savings?: " . $row["ZG_DST"]. ""); echo("Latitude: " . $row["ZG_LATITUDE"]. ""); echo("Longitude: " . $row["ZG_LONGITUDE"]. ""); } ?> 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
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: Error performing query: " . mysql_error() . ""); exit(); } $Lat2 = mysql_query( "SELECT (ZG_LATITUDE+2) FROM zip_code where zg_zipcode = '$zip'"); if (!$Lat2) { echo("Error performing query: " . mysql_error() . ""); exit(); } $Lon1 = mysql_query( "SELECT (ZG_LONGITUDE-2) FROM zip_code where zg_zipcode = '$zip'"); if (!$Lon1) { echo("Error performing query: " . mysql_error() . ""); exit(); } $Lon2 = mysql_query( "SELECT (ZG_LONGITUDE+2) FROM zip_code where zg_zipcode = '$zip'"); if (!$Lon2) { echo("Error performing query: " . mysql_error() . ""); 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("Error performing query: " . mysql_error() . ""); exit(); } while ( $row = mysql_fetch_array($ZipCode) ) { echo("City: " . $row["ZG_CITY"]. ""); echo("State: " . $row["ZG_STATE"]. ""); echo("Zip Code: " . $row["ZG_ZIPCODE"]. ""); echo("Area Code: " . $row["ZG_AREACODE"]. ""); echo("County FIPS: " . $row["ZG_COUNTY_FIPS"]. ""); echo("County Name: " . $row["ZG_COUNTY_NAME"]. ""); echo("Time Zone: " . $row["ZG_TIME_ZONE"]. ""); echo("Day Light Savings?: " . $row["ZG_DST"]. ""); echo("Latitude: " . $row["ZG_LATITUDE"]. ""); echo("Longitude: " . $row["ZG_LONGITUDE"]. ""); } ?> 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-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: Error performing query: " . mysql_error() . ""); exit(); } $Lat2 = mysql_query( "SELECT (ZG_LATITUDE+2) FROM zip_code where zg_zipcode = '$zip'"); if (!$Lat2) { echo("Error performing query: " . mysql_error() . ""); exit(); } $Lon1 = mysql_query( "SELECT (ZG_LONGITUDE-2) FROM zip_code where zg_zipcode = '$zip'"); if (!$Lon1) { echo("Error performing query: " . mysql_error() . ""); exit(); } $Lon2 = mysql_query( "SELECT (ZG_LONGITUDE+2) FROM zip_code where zg_zipcode = '$zip'"); if (!$Lon2) { echo("Error performing query: " . mysql_error() . ""); 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("Error performing query: " . mysql_error() . ""); exit(); } while ( $row = mysql_fetch_array($ZipCode) ) { echo("City: " . $row["ZG_CITY"]. ""); echo("State: " . $row["ZG_STATE"]. ""); echo("Zip Code: " . $row["ZG_ZIPCODE"]. ""); echo("Area Code: " . $row["ZG_AREACODE"]. ""); echo("County FIPS: " . $row["ZG_COUNTY_FIPS"]. ""); echo("County Name: " . $row["ZG_COUNTY_NAME"]. ""); echo("Time Zone: " . $row["ZG_TIME_ZONE"]. ""); echo("Day Light Savings?: " . $row["ZG_DST"]. ""); echo("Latitude: " . $row["ZG_LATITUDE"]. ""); echo("Longitude: " . $row["ZG_LONGITUDE"]. ""); } ?> 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
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
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
"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
Re: [PHP-DB] PHP and mysql script error in webhosting
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 and mysql script error in webhosting
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 and PostgresSQL at the same time
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
Re: [PHP-DB] php and MySQL and PostgresSQL at the same time
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
[PHP-DB] php and MySQL and PostgresSQL at the same time
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 database question ??
> 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 database question ??
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 4
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
Re: [PHP-DB] PHP and MySQL 4
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
[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
Re: [PHP-DB] Php and mysql, a rookie problem.
Make a script to dump phpinfo() I don't think mysql support was part of your PHP binary. Just get the Apache source and PHP source and re-build it, then you KNOW what is in there and what is not. -Brad > 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. > > > -- 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.
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!
It looks like the problems is because $date and $host are in different 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 "Choose date > > > > > > > maxlength=10>" ; > echo "" ; > > $temphost = $host; > echo "Choose host > > > > > > > maxlength=10>" ; > echo "" ; > > I then would concat the values to query the database as follow: > > echo " href=\"build_form.php?select=all&date=$date&host=$host&order=$order&orde rt > wo=$ordertwo&way=$way&waytwo=$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!
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 "Choose date > > > > > > > value=\"$tempdate\" size=17 > maxlength=10>" ; > echo "" ; > > $temphost = $host; > echo "Choose host > > > > > > > value=\"$temphost\" size=17 > maxlength=10>" ; > echo "" ; > > I then would concat the values to query the database as follow: > > echo " href=\"build_form.php?select=all&date=$date&host=$host&order=$ > order&ordertwo=$ordertwo&way=$way&waytwo=$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
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 "Choose date " ; echo "" ; $temphost = $host; echo "Choose host " ; echo "" ; I then would concat the values to query the database as follow: echo " 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!
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
[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
Re: [PHP-DB] php and mysql on RH8.0
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
AW: [PHP-DB] php and mysql on RH8.0
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
[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!
Re: [PHP-DB] PHP and MySQL
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
[PHP-DB] PHP and MySQL
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
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
Re: [PHP-DB] php and mysql
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
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
[PHP-DB] PHP and MySQL form problem - Undifined variables
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 -- %s %s\n", $PHP_SELF, $myrow["id"], $myrow["first"], $myrow["last"] ); } while ($myrow = mysql_fetch_array($result)); } else { echo "Sorry, no records were found!"; } ?> //-- 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
RE: [PHP-DB] php and mysql security problem
Use $AUTH_USER for the username, and you shouldn't need to pass the password. Just do a query: INSERT INTO tablename (field1,field2,field3) values('','','') where username = $AUTH_USER Ryan Marrs Web Developer Sandler and Travis Trade Advisory Services, Inc. 248.474.7200 x 183 http://www.strtrade.com -Original Message- From: Jack [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 11:37 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] php and mysql security problem 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] -- 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
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]
[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...
> 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]
[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...
-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...
RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...Agreed. Personally, I refuse to keep date values in fields that are not DATE fields of some kind. Too much trouble. TIM -How do "Do Not Walk On Grass" signs get there? -Original Message- From: Robinson, Mike [mailto:[EMAIL PROTECTED]] 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.
[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...
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 - Canadas 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]
Re: [PHP-DB] PHP and MySQL queries...
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]
Re: [PHP-DB] PHP and MySQL queries...
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...
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:MM200112251200< 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-DB] RE: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...
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 - Canadas 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]
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 "Kodrik" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Why don't you let them enter it however they want in the form > mm-dd- > mm/dd/yy > > then in the php script that processes it, convert it with regulat expressions > to a timstamp and enter it in your database as an int. That's how I do it. > I don't understand the point in using the mysql timedate field format. > > Then on retrieval form the db, php can easily convert it to a nice format > with the date() function. > > > 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... > > > > > > *I.E. - Format is 04/01/2001* > > > Search for Ads by date: > > > > > > > > > > > > > > value="Submit"> > > > > > value="Reset"> > > > > > > > > > On my search.php page I have the following MySQL connection and search > > > parameters... > > > > > > > > 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,cry > > >r,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 "Name: "; > > > printf(mysql_result($result,$count,"fname")); > > > echo " "; > > > printf(mysql_result($result,$count,"lname")); > > > echo "\n"; > > > > > > echo "Address: "; > > > printf(mysql_result($result,$count,"address")); > > > echo "\n"; > > > > > > echo "City: "; > > > printf(mysql_result($result,$count,"city")); > > > echo "\n"; > > > > > > echo "State: "; > > > printf(mysql_result($result,$count,"state")); > > > echo "\n"; > > > > > > echo "Zip: "; > > > printf(mysql_result($result,$count,"zip")); > > > echo "\n"; > > > > > > echo "Phone: ("; > > > printf(mysql_result($result,$count,"phonea")); > > > echo ") "; > > > printf(mysql_result($result,$count,"phone")); > > > echo "\n"; > > > > > > echo "Email: "; > > > printf(mysql_result($result,$count,"email")); > > > echo "\n"; > > > > > > echo "Credit Type: "; > > > printf(mysql_result($result,$count,"crty")); > > > echo "\n"; > > > > > > echo "Credit Number: "; > > > printf(mysql_result($result,$count,"crnum")); > > > echo "\n"; > > > > > > echo "Credit Card Date: "; > > > printf(mysql_result($result,$count,"crmo")); > > > echo " "; > > > printf(mysql_result($result,$count,"cryr")); > > > echo "\n"; > > > > > > echo "Weeks: "; > > > printf(mysql_result($result,$count,"weeks")); > > > echo "\n"; > > > > > > echo "town1: "; > > > printf(mysql_result($result,$count,"town1")); > > > echo "\n"; > > > > > > echo "town2: "; > > > printf(mysql_result($result,$count,"town2")); > > > echo "\n"; > > > > > > echo "town3: "; > > > printf(mysql_result($result,$count,"town3")); > > > echo "\n"; > > > > > > echo "IP Address: "; > > > printf(mysql_result($result,$count,"ipaddress")); > > > echo "\n"; > > > > > > echo "Ad: "; > > > > > > $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 "\n"; > > > > > > echo "Total: "; > > > printf(mysql_result($result,$count,"total")); > > > echo "\n"; > > > > > > echo "Ad Number: "; > > > printf(mysql_result($result,$count,"num")); > > > echo "\n"; > > > > > > echo "Date: "; > > > printf(mysql_result($result,$count,"date")); > > > echo "\n"; > > > > > > echo "Time: "; > > > printf(mysql_result($result,$count,"time")); > > > echo "\n"; > > > > > > } while($row = mysql_fetch_array($result)); > > > > > > } else {print "Sorry, no records were found!";} > > > > > > ?> > > > So far I
Re: [PHP-DB] PHP and MySQL queries...
Why don't you let them enter it however they want in the form mm-dd- mm/dd/yy then in the php script that processes it, convert it with regulat expressions to a timstamp and enter it in your database as an int. That's how I do it. I don't understand the point in using the mysql timedate field format. Then on retrieval form the db, php can easily convert it to a nice format with the date() function. > 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... > > > > *I.E. - Format is 04/01/2001* > > Search for Ads by date: > > > > > > > > > value="Submit"> > > > value="Reset"> > > > > > > On my search.php page I have the following MySQL connection and search > > parameters... > > > > > 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,cry > >r,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 "Name: "; > > printf(mysql_result($result,$count,"fname")); > > echo " "; > > printf(mysql_result($result,$count,"lname")); > > echo "\n"; > > > > echo "Address: "; > > printf(mysql_result($result,$count,"address")); > > echo "\n"; > > > > echo "City: "; > > printf(mysql_result($result,$count,"city")); > > echo "\n"; > > > > echo "State: "; > > printf(mysql_result($result,$count,"state")); > > echo "\n"; > > > > echo "Zip: "; > > printf(mysql_result($result,$count,"zip")); > > echo "\n"; > > > > echo "Phone: ("; > > printf(mysql_result($result,$count,"phonea")); > > echo ") "; > > printf(mysql_result($result,$count,"phone")); > > echo "\n"; > > > > echo "Email: "; > > printf(mysql_result($result,$count,"email")); > > echo "\n"; > > > > echo "Credit Type: "; > > printf(mysql_result($result,$count,"crty")); > > echo "\n"; > > > > echo "Credit Number: "; > > printf(mysql_result($result,$count,"crnum")); > > echo "\n"; > > > > echo "Credit Card Date: "; > > printf(mysql_result($result,$count,"crmo")); > > echo " "; > > printf(mysql_result($result,$count,"cryr")); > > echo "\n"; > > > > echo "Weeks: "; > > printf(mysql_result($result,$count,"weeks")); > > echo "\n"; > > > > echo "town1: "; > > printf(mysql_result($result,$count,"town1")); > > echo "\n"; > > > > echo "town2: "; > > printf(mysql_result($result,$count,"town2")); > > echo "\n"; > > > > echo "town3: "; > > printf(mysql_result($result,$count,"town3")); > > echo "\n"; > > > > echo "IP Address: "; > > printf(mysql_result($result,$count,"ipaddress")); > > echo "\n"; > > > > echo "Ad: "; > > > > $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 "\n"; > > > > echo "Total: "; > > printf(mysql_result($result,$count,"total")); > > echo "\n"; > > > > echo "Ad Number: "; > > printf(mysql_result($result,$count,"num")); > > echo "\n"; > > > > echo "Date: "; > > printf(mysql_result($result,$count,"date")); > > echo "\n"; > > > > echo "Time: "; > > printf(mysql_result($result,$count,"time")); > > echo "\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.ne
Re: [PHP-DB] PHP and MySQL queries...
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... > > *I.E. - Format is 04/01/2001* > Search for Ads by date: > > > > value="Submit"> > > > > > On my search.php page I have the following MySQL connection and search > parameters... > > 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 "Name: "; > printf(mysql_result($result,$count,"fname")); > echo " "; > printf(mysql_result($result,$count,"lname")); > echo "\n"; > > echo "Address: "; > printf(mysql_result($result,$count,"address")); > echo "\n"; > > echo "City: "; > printf(mysql_result($result,$count,"city")); > echo "\n"; > > echo "State: "; > printf(mysql_result($result,$count,"state")); > echo "\n"; > > echo "Zip: "; > printf(mysql_result($result,$count,"zip")); > echo "\n"; > > echo "Phone: ("; > printf(mysql_result($result,$count,"phonea")); > echo ") "; > printf(mysql_result($result,$count,"phone")); > echo "\n"; > > echo "Email: "; > printf(mysql_result($result,$count,"email")); > echo "\n"; > > echo "Credit Type: "; > printf(mysql_result($result,$count,"crty")); > echo "\n"; > > echo "Credit Number: "; > printf(mysql_result($result,$count,"crnum")); > echo "\n"; > > echo "Credit Card Date: "; > printf(mysql_result($result,$count,"crmo")); > echo " "; > printf(mysql_result($result,$count,"cryr")); > echo "\n"; > > echo "Weeks: "; > printf(mysql_result($result,$count,"weeks")); > echo "\n"; > > echo "town1: "; > printf(mysql_result($result,$count,"town1")); > echo "\n"; > > echo "town2: "; > printf(mysql_result($result,$count,"town2")); > echo "\n"; > > echo "town3: "; > printf(mysql_result($result,$count,"town3")); > echo "\n"; > > echo "IP Address: "; > printf(mysql_result($result,$count,"ipaddress")); > echo "\n"; > > echo "Ad: "; > > $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 "\n"; > > echo "Total: "; > printf(mysql_result($result,$count,"total")); > echo "\n"; > > echo "Ad Number: "; > printf(mysql_result($result,$count,"num")); > echo "\n"; > > echo "Date: "; > printf(mysql_result($result,$count,"date")); > echo "\n"; > > echo "Time: "; > printf(mysql_result($result,$count,"time")); > echo "\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] PHP and MySQL queries...
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... *I.E. - Format is 04/01/2001* Search for Ads by date: On my search.php page I have the following MySQL connection and search parameters... Name: "; printf(mysql_result($result,$count,"fname")); echo " "; printf(mysql_result($result,$count,"lname")); echo "\n"; echo "Address: "; printf(mysql_result($result,$count,"address")); echo "\n"; echo "City: "; printf(mysql_result($result,$count,"city")); echo "\n"; echo "State: "; printf(mysql_result($result,$count,"state")); echo "\n"; echo "Zip: "; printf(mysql_result($result,$count,"zip")); echo "\n"; echo "Phone: ("; printf(mysql_result($result,$count,"phonea")); echo ") "; printf(mysql_result($result,$count,"phone")); echo "\n"; echo "Email: "; printf(mysql_result($result,$count,"email")); echo "\n"; echo "Credit Type: "; printf(mysql_result($result,$count,"crty")); echo "\n"; echo "Credit Number: "; printf(mysql_result($result,$count,"crnum")); echo "\n"; echo "Credit Card Date: "; printf(mysql_result($result,$count,"crmo")); echo " "; printf(mysql_result($result,$count,"cryr")); echo "\n"; echo "Weeks: "; printf(mysql_result($result,$count,"weeks")); echo "\n"; echo "town1: "; printf(mysql_result($result,$count,"town1")); echo "\n"; echo "town2: "; printf(mysql_result($result,$count,"town2")); echo "\n"; echo "town3: "; printf(mysql_result($result,$count,"town3")); echo "\n"; echo "IP Address: "; printf(mysql_result($result,$count,"ipaddress")); echo "\n"; echo "Ad: "; $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 "\n"; echo "Total: "; printf(mysql_result($result,$count,"total")); echo "\n"; echo "Ad Number: "; printf(mysql_result($result,$count,"num")); echo "\n"; echo "Date: "; printf(mysql_result($result,$count,"date")); echo "\n"; echo "Time: "; printf(mysql_result($result,$count,"time")); echo "\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]
[PHP-DB] Php and Mysql: Aborted connection to mySQL with PHP4
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]
[PHP-DB] PHP and MYSQL
Hi all, I have a form where I collect some information and then that information is saved on a local db (mysql). The problem that I'm having is that when the server is up an running for few hours and when a user clicks the send button, my page take a long time to communicate with my database and at the end, I get an e-mail from the output. But what's really strange is that if I reboot then server and try the page, everything works really fast and in matter of seconds I get my confirmation e-mail. I'm wondering if there are some settings that I can tweak on the server, OS or on the CMOS to avoid that kind of delay in my form. I'm guessing that probably after some time the server is going into sleep mode or something. I'm using PHP4.0 , mysql and apache. Thanks again for any information, -hb -- 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
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 and MySQL
Well, where did you install it? If the header files are under /usr/local/mysql/include and the library files are under /usr/local/mysql/lib (for example) then you would need to tell PHP to use --with-mysql=/usr/local/mysql since PHP needs to be able to find both the header and library files somewhere under the path you give it. -Rasmus On Thu, 19 Apr 2001, Mike Corredea wrote: > 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] > -- 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
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
hi, you could do it in a easier way, first put real names for the fields in your form: login : group : password : , 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
Hi, my exact problem is the following. Here is my form : login : group : password : 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
Laurent, Show us the code/statements you are using. It is easier to help you that way. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 14, 2001 1:43 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] PHP and MySQL 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] -- 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
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]
Re: [PHP-DB] PHP and MYSQL query
Use mysql_error() can give a hint of what is going wrong. $result = mysql_query($query) or die( mysql_error()); HTH Jayme. -Mensagem Original- De: Oson, Chris M. <[EMAIL PROTECTED]> Para: Jim Ray <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Enviada em: sábado, 10 de março de 2001 16:57 Assunto: RE: [PHP-DB] PHP and MYSQL query > For starters, your statement is wrong... > > $result = mysql_query($strSQL, $db); > > where $db is your connection string to the database you already have opened. > > If you have problems with your sql statement, try something like this and > see > what your results are: > > $strSQL = "SELECT * FROM $TA WHERE $SortField = '$search%' ORDER BY > $SortField"; > print $strSQL; > > $result = mysql_query($strSQL); > > Once you have the results of the query printed out, copy and paste it into > the > command line in mySQL. You'll know if you're doing something wrong or not. > > -Original Message- > From: Jim Ray [mailto:[EMAIL PROTECTED]] > Sent: Friday, March 09, 2001 8:03 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] PHP and MYSQL query > > > I have a simpe query that I can not seem to get to work. > > Here is the HTML side: > action="luquery.php?DB=csjoa&TA=associates&SortField=company" > method="post"> type="submit"> > > > > 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] > -- 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
For starters, your statement is wrong... $result = mysql_query($strSQL, $db); where $db is your connection string to the database you already have opened. If you have problems with your sql statement, try something like this and see what your results are: $strSQL = "SELECT * FROM $TA WHERE $SortField = '$search%' ORDER BY $SortField"; print $strSQL; $result = mysql_query($strSQL); Once you have the results of the query printed out, copy and paste it into the command line in mySQL. You'll know if you're doing something wrong or not. -Original Message- From: Jim Ray [mailto:[EMAIL PROTECTED]] Sent: Friday, March 09, 2001 8:03 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] PHP and MYSQL query I have a simpe query that I can not seem to get to work. Here is the HTML side: 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 query
First, try just calling the form action like: Turning the & 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: > action="luquery.php?DB=csjoa&TA=associates&SortField=company" > method="post"> type="submit"> > > 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]
[PHP-DB] PHP and MYSQL query
I have a simpe query that I can not seem to get to work. Here is the HTML side: 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]
Re: [PHP-DB] php and mysql file insertion!
Yeah, but I also want t do some encrpyption stuff and I have to store a *.pgp file! I suppose I could do the same for this but I would prefer to have them both in the database! -Kev. - Original Message - From: "David Balatero" <[EMAIL PROTECTED]> To: "Rick Emery" <[EMAIL PROTECTED]> Cc: "'Kevin Connolly'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, March 06, 2001 8:03 PM Subject: Re: [PHP-DB] php and mysql file insertion! > Couldn't you also just store the image on the server, then put the path to the > image (http://www.mysite.com/images/thatimg.jpg) in the database? > > -- David Balatero > > Rick Emery wrote: > > > Yes. There's another tutorial on the site which addresses that question. > > > > rick > > -Original Message- > > From: Kevin Connolly [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, March 06, 2001 1:39 PM > > To: Rick Emery > > Subject: Re: [PHP-DB] php and mysql file insertion! > > > > great thanks! > > Will I be able to save different file types do you know? > > wull it work for non-picture files? > > Thanks again, > > Kev. > > - Original Message ----- > > From: "Rick Emery" <[EMAIL PROTECTED]> > > To: "'Kevin Connolly'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Tuesday, March 06, 2001 7:28 PM > > Subject: RE: [PHP-DB] php and mysql file insertion! > > > > > That link just failed me... > > > > > > Anyway, go to http://www.weberdev.com. Select the "Articles and > > Tutorials" > > > link at the left. Go to the "PHP" link. > > > Select the "Graphics" link. Select the article "Saving Images in MySQL". > > > > > > rick > > > -Original Message- > > > From: Rick Emery > > > Sent: Tuesday, March 06, 2001 1:23 PM > > > To: 'Kevin Connolly'; '[EMAIL PROTECTED]' > > > Subject: RE: [PHP-DB] php and mysql file insertion! > > > > > > > > > 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] > > > > > > > -- > > 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!
Yes, you can. But you still ahve to extract it and format it for display. The tutorial explains the ins and outs of the process. -Original Message- From: David Balatero [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 06, 2001 2:03 PM To: Rick Emery Cc: 'Kevin Connolly'; '[EMAIL PROTECTED]' Subject: Re: [PHP-DB] php and mysql file insertion! Couldn't you also just store the image on the server, then put the path to the image (http://www.mysite.com/images/thatimg.jpg) in the database? -- David Balatero Rick Emery wrote: > Yes. There's another tutorial on the site which addresses that question. > > rick > -Original Message- > From: Kevin Connolly [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 06, 2001 1:39 PM > To: Rick Emery > Subject: Re: [PHP-DB] php and mysql file insertion! > > great thanks! > Will I be able to save different file types do you know? > wull it work for non-picture files? > Thanks again, > Kev. > - Original Message - > From: "Rick Emery" <[EMAIL PROTECTED]> > To: "'Kevin Connolly'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Tuesday, March 06, 2001 7:28 PM > Subject: RE: [PHP-DB] php and mysql file insertion! > > > That link just failed me... > > > > Anyway, go to http://www.weberdev.com. Select the "Articles and > Tutorials" > > link at the left. Go to the "PHP" link. > > Select the "Graphics" link. Select the article "Saving Images in MySQL". > > > > rick > > -Original Message- > > From: Rick Emery > > Sent: Tuesday, March 06, 2001 1:23 PM > > To: 'Kevin Connolly'; '[EMAIL PROTECTED]' > > Subject: RE: [PHP-DB] php and mysql file insertion! > > > > > > 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] > > > > -- > 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!
Couldn't you also just store the image on the server, then put the path to the image (http://www.mysite.com/images/thatimg.jpg) in the database? -- David Balatero Rick Emery wrote: > Yes. There's another tutorial on the site which addresses that question. > > rick > -Original Message- > From: Kevin Connolly [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 06, 2001 1:39 PM > To: Rick Emery > Subject: Re: [PHP-DB] php and mysql file insertion! > > great thanks! > Will I be able to save different file types do you know? > wull it work for non-picture files? > Thanks again, > Kev. > - Original Message - > From: "Rick Emery" <[EMAIL PROTECTED]> > To: "'Kevin Connolly'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Tuesday, March 06, 2001 7:28 PM > Subject: RE: [PHP-DB] php and mysql file insertion! > > > That link just failed me... > > > > Anyway, go to http://www.weberdev.com. Select the "Articles and > Tutorials" > > link at the left. Go to the "PHP" link. > > Select the "Graphics" link. Select the article "Saving Images in MySQL". > > > > rick > > -Original Message- > > From: Rick Emery > > Sent: Tuesday, March 06, 2001 1:23 PM > > To: 'Kevin Connolly'; '[EMAIL PROTECTED]' > > Subject: RE: [PHP-DB] php and mysql file insertion! > > > > > > 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] > > > > -- > 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!
Yes. There's another tutorial on the site which addresses that question. rick -Original Message- From: Kevin Connolly [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 06, 2001 1:39 PM To: Rick Emery Subject: Re: [PHP-DB] php and mysql file insertion! great thanks! Will I be able to save different file types do you know? wull it work for non-picture files? Thanks again, Kev. - Original Message - From: "Rick Emery" <[EMAIL PROTECTED]> To: "'Kevin Connolly'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, March 06, 2001 7:28 PM Subject: RE: [PHP-DB] php and mysql file insertion! > That link just failed me... > > Anyway, go to http://www.weberdev.com. Select the "Articles and Tutorials" > link at the left. Go to the "PHP" link. > Select the "Graphics" link. Select the article "Saving Images in MySQL". > > rick > -Original Message- > From: Rick Emery > Sent: Tuesday, March 06, 2001 1:23 PM > To: 'Kevin Connolly'; '[EMAIL PROTECTED]' > Subject: RE: [PHP-DB] php and mysql file insertion! > > > 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] > -- 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!
Kevin, You generally get much better performance naming and storing your file in a directory, keeping only the link in a text field in MySQL. (Or just about any other database for that matter.) Miles Thompson At 06:27 PM 3/6/01 +, Kevin Connolly wrote: >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]
RE: [PHP-DB] php and mysql file insertion!
That link just failed me... Anyway, go to http://www.weberdev.com. Select the "Articles and Tutorials" link at the left. Go to the "PHP" link. Select the "Graphics" link. Select the article "Saving Images in MySQL". rick -Original Message- From: Rick Emery Sent: Tuesday, March 06, 2001 1:23 PM To: 'Kevin Connolly'; '[EMAIL PROTECTED]' Subject: RE: [PHP-DB] php and mysql file insertion! 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]
RE: [PHP-DB] php and mysql file insertion!
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]
[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.