[PHP-DB] searching for zipcode: where to start?
hello, I want to create a database search with php/mysql that searches for zipcodes in a database. of course, there will be other columns/tables and such to be printed, but I only want to search for the zipcodes and have the other cells printed if the following criteria are found: lets say I search for the zipcode 90232...it would return like so 1. search returns 3 closest matches John Doe 90232 Red Corvette Mary Jones 90235 Silver Camaro Peter Gooding 90065 Blue Honda et - the search will generate only 3 returns...either 3 exact matches, in this case 90232 or (1, or 2) and the closestBasically the search will ALWAYS return 3 results, either exact matches or closest matches..any combination..so every entry in the database is a potential match...just the 3 closest what is the best way to go about doing this? _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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] searching for zipcode: where to start?
full-text index that field in MySQL, - then query ordered by weight with a limit 3. Wonderful stuff. -Original Message- From: dean james Sent: Sat 11/10/2001 7:27 PM To: [EMAIL PROTECTED] Cc: Subject: [PHP-DB] searching for zipcode: where to start? hello, I want to create a database search with php/mysql that searches for zipcodes in a database. of course, there will be other columns/tables and such to be printed, but I only want to search for the zipcodes and have the other cells printed if the following criteria are found: lets say I search for the zipcode 90232...it would return like so 1. search returns 3 closest matches John Doe 90232 Red Corvette Mary Jones 90235 Silver Camaro Peter Gooding 90065 Blue Honda et - the search will generate only 3 returns...either 3 exact matches, in this case 90232 or (1, or 2) and the closestBasically the search will ALWAYS return 3 results, either exact matches or closest matches..any combination..so every entry in the database is a potential match...just the 3 closest what is the best way to go about doing this? _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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] Pulling Zip Codes from USPS
I had a tutorial bookmarked at one point on how to pull zip codes from the USPS search or something like this. There are a couple benefits to this - 1. it's always up to date 2. it's complete and 3. it's free. I would like to use something like this now. Does anyone have a link to tutorial or know of a resource like this? thanks __ Do You Yahoo!? Find a job, post your resume. http://careers.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]
[PHP-DB] [php - mysql] create_table
Hi, with the php-command mysql_create_db (my_db); i can create an mySQL-Database. How can I create a table in this database ? I found no command in the php.net-manual. --- H3N --- -- 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] Random Row From Database
Hi, I'm trying to pull a random row from my database and display the contents. I know that the code: SELECT * FROM TABLENAME WHERE RAND() LIMIT 1 should work. However, there are 19 rows in the database and only the first row ever shows up. Is there a way to do this to ensure uniqueness? The code I am using at the moment also filters so that rows are pulled from the database given certain other criteria such as: SELECT * FROM TABLENAME WHERE PayerID=$id AND RAND() LIMIT 1 All of the rows in the database contain the same PayerID and this column is not the Primary Key. Any help much appreciated. Jonathan S Hardiman President/CEO Hardiman Enterprises Worldwide -- 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] How do i search my database...
Hi All, I have a database with only three fields FIELD 1 FIELD 2 FIELD 3 I want the user to input into FIELD 3, and then my script to go of to my database and see if it finds a match or something like the input and display it to the screen. Please help as i can't seem to get my brain around this Thanks in Advance -- 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] XML coming out from MySQL
I've never parsed XML with PHP, but it might help if you can show the document that's breaking the parser, and also let us know if other documents are working fine... -Lorenzo Hi, The document is like this: ?xml version=1.0 encoding=iso-8859-1? articulo volantaSome text/volanta tituloSome text/titulo bajadaSome text/bajada parrafoSome text/parrafo urlhttp://whatever.com//url copyWhomever 2001/copy /articulo Up to now, I solve the problem modifying the lines saying while ($data = $file) { if (!xml_parse($xml_parser, $data, 0)) { die(sprintf(XML error: %s at line %d, xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } into xml_parse($xml_parser, $data, 0); I'd noticed that I don't need to read the document line by line. Regards and thanks, Tomás +-- --+ Tomás García Ferrari Bigital http://bigital.com/ +-- --+ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: JOIN operations
SELECT table_name.name, table_name.ID_city, table_city.ID, table_city.city, FROM table_name, table_city WHERE table_name.ID_city=table_city.ID Carlo loiudice wrote: Hi, I'm preforming a join between 2 Mysql tables in this way: table_name: ID,name,ID_city table_city: ID,city when I query this: SELECT table_name.name,table_city.ID,table_city.city FROM table_name,table_city WHERE table_name.ID_city=table_city.ID The result is a new table with this fields: result_table: name,city. There isn't the field table_name.ID_city!!! Here's the question: I need also this field ID_city because there's a function that builds a list box with all the cities, and search for a html hidden input named ID_city (like the table field) to eventually highlight that entry. can someone help me? is there a way to select also the ID_city field without break the join mechanism ? Carlo __ Abbonati a Yahoo! ADSL con Atlanet! Naviga su Internet ad alta velocità, e senza limiti di tempo! Per saperne di più vai alla pagina http://adsl.yahoo.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-DB] PHP 4.0.6 InterBase Bug
PHP 4.0.6 reports warning about invalid statement handle after I use ibase_close() to close opened with ibase_connect() database connection. If I comment ibase_close that removes the warning. Please don't forget to fix this in the next PHP release. In the mean time I went back to PHP 4.0.5, which works just fine. Thanks for your help, -Jorge -- 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] odbc_columns() help
Hi, Does anyone manage to get odbc_columns(). If you so, can you give me an example, what version of PHP you are using? I've tried various combination of odbc_columns() and never get it to work. Any help would be greatly appreciated. Thank you, --kent -- 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] parse-error MySQL - PhP @ win2000
Hi all, I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I know, I should be running linux; That will have to come with time). But now I am trying to learn PhP - MySQL. When running the script below I get the error message: Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 Is there anybody who knows what the problem might be? I think is in the result display part, considering how things run properly when I leave it out. Hopefully you ca get me going, since I do not know what I am doing wrong!! Thanks for the help, Jelle ? $host=localhost; $username=; $password=; $database=jelle_test; $table=pet; $db = mysql_connect($host) or die (verbinding maken met de server is mislukt); Echo gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db; @mysql_select_db($database, $db) or die (Helaas geen verbinding kunnen maken met de database); $sql_select = Select * from pet; $result = mysql_query($sql_select, $db); if($result) { echo Selectie succesvol; while ( $resultaat = mysql_fetch_row($result)) { printf($resultaat[0]); } mysql_close($db); ? -- ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl ** Mankind: Intelligent enough to make a strong impact on the environment, But not strong enough to make an intelligent one! ** ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl ** Mankind: Intelligent enough to make a strong impact on the environment, But not strong enough to make an intelligent one! **
Re: [PHP-DB] parse-error MySQL - PhP @ win2000
Dag Jelle, Als je printf(); gebruikt moet je dit wel correct doen, met print(); zou het goed moeten gaan. Dus regel 24 wordt: print ($resultaat[0]); (Excuse me muttering Dutch between the two of us :) M.vr.gr. Roel Mulder At 21:32 10-11-2001 +0100, you wrote: Hi all, I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I know, I should be running linux; That will have to come with time). But now I am trying to learn PhP - MySQL. When running the script below I get the error message: Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 Is there anybody who knows what the problem might be? I think is in the result display part, considering how things run properly when I leave it out. Hopefully you ca get me going, since I do not know what I am doing wrong!! Thanks for the help, Jelle ? $host=localhost; $username=; $password=; $database=jelle_test; $table=pet; $db = mysql_connect($host) or die (verbinding maken met de server is mislukt); Echo gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db; @mysql_select_db($database, $db) or die (Helaas geen verbinding kunnen maken met de database); $sql_select = Select * from pet; $result = mysql_query($sql_select, $db); if($result) { echo Selectie succesvol; while ( $resultaat = mysql_fetch_row($result)) { printf($resultaat[0]); } mysql_close($db); ? -- ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl Mulder Technisch Advies Postbus 69 NL-2740 AB WADDINXVEEN tel. 0182-640184 fax. 0182-640185 http://www.mta.nl -- 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] parse-error MySQL - PhP @ win2000
Hi Jelle, - Original Message - I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I know, I should be running linux; That will have to come with time). But now I am trying to learn PhP - MySQL. When running the script below I get the error message: Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 Is there anybody who knows what the problem might be? I think is in the result display part, considering how things run properly when I leave it out. Hopefully you ca get me going, since I do not know what I am doing wrong!! Thanks for the help, Jelle ? $host=localhost; $username=; $password=; $database=jelle_test; $table=pet; $db = mysql_connect($host) or die (verbinding maken met de server is mislukt); Echo gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db; @mysql_select_db($database, $db) or die (Helaas geen verbinding kunnen maken met de database); $sql_select = Select * from pet; $result = mysql_query($sql_select, $db); if($result) { echo Selectie succesvol; while ( $resultaat = mysql_fetch_row($result)) { printf($resultaat[0]); } mysql_close($db); ? =an error message that quotes a line number AFTER the end of the script indicates that some entity has been opened but not closed. In this case curly brackets. =Various source code formatting conventions exist to try to avoid the situation (that we have here) where the appearance of the source code works to deceive brain and eye. There has been some debate in PHP forums about the 'best' way (FWIW my opinion: whatever works=best), and this is an excellent illustration of why coding the opening bracket of a code block this way, may not be best way! The code-block indentation is not consistent which further disguises the omission. =Regards, =dn -- 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] parse-error MySQL - PhP @ win2000
Thanks very much for the assistence: The curly-bracket thing did it! Now I finally know the installation has been succesfull! I'll try to start programming less sloppy, and spare you from these silly errors! I'll notify you when the site is up and running. Future site location: www.hyperspectral.info J. ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl ** Mankind: Intelligent enough to make a strong impact on the environment, But not strong enough to make an intelligent one! ** - Original Message - From: Roel Mulder [EMAIL PROTECTED] To: Jelle Ferwerda [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, November 10, 2001 10:39 PM Subject: Re: [PHP-DB] parse-error MySQL - PhP @ win2000 Dag Jelle, Als je printf(); gebruikt moet je dit wel correct doen, met print(); zou het goed moeten gaan. Dus regel 24 wordt: print ($resultaat[0]); (Excuse me muttering Dutch between the two of us :) M.vr.gr. Roel Mulder At 21:32 10-11-2001 +0100, you wrote: Hi all, I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I know, I should be running linux; That will have to come with time). But now I am trying to learn PhP - MySQL. When running the script below I get the error message: Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 Is there anybody who knows what the problem might be? I think is in the result display part, considering how things run properly when I leave it out. Hopefully you ca get me going, since I do not know what I am doing wrong!! Thanks for the help, Jelle ? $host=localhost; $username=; $password=; $database=jelle_test; $table=pet; $db = mysql_connect($host) or die (verbinding maken met de server is mislukt); Echo gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db; @mysql_select_db($database, $db) or die (Helaas geen verbinding kunnen maken met de database); $sql_select = Select * from pet; $result = mysql_query($sql_select, $db); if($result) { echo Selectie succesvol; while ( $resultaat = mysql_fetch_row($result)) { printf($resultaat[0]); } mysql_close($db); ? -- ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl Mulder Technisch Advies Postbus 69 NL-2740 AB WADDINXVEEN tel. 0182-640184 fax. 0182-640185 http://www.mta.nl -- 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] trouble with simple logfile-script
Hi all, I use a small php-script for generating some simple weekly weblog for a site with about 3.000 vists / day. I do not want to log IP or dates, I just want to count pageimpressions for all the html/php-files seperately. A friend helped me with the script, but although it does exactly what I want, we have some trouble with it: For every page we have an entry in the sql-database with fields for page (seite) / week (kw) / number of hits (anzahl). Sometimes the script inserts a new entry, so that there are two, three or even twenty entries for the same page in the same week. As you will see the code checks if there is already an entry for the actual file / actual week, and if so it should just counts hits. Sometimes (on the average two times a day) the script generates a new entry and then logs in both, the original entry and the new, false one. Two days ago it started creating so many new entries that my isp had to block the database because it consumed to much server-ressources... Any help would be very appreciated. Torsten setlocale(LC_TIME,de); $kw=strftime(%W); if(!isset($id)) $id = NN; $logdata=$bloede-select(select * from bloede_log where kw = $kw AND seite ='$id'); if(sizeof($logdata) == 0) $bloede-insert(insert into bloede_log (kw, seite, anzahl) values ($kw, '$id', 1)); else $bloede-insert(update bloede_log set anzahl = (anzahl+1) where kw = $kw AND seite = '$id'); $logdata = ; if($id == NN) { Header(Location: index.php4); exit; } -- 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]