[PHP-DB] Re: An old question...
Look at http://www.php.net/docs.php , there is a version in spanish. (mira en http://www.php.net/docs.php , hay una copia en español) Javier Mestre Lic. Daniel Alfredo Betancourt Reboso [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi everyone!! Certainly it is an old question. How can I start learning PHP?. I need to use it with MySQL. Any suggestions? I´m a none English speaker. Thank´s Daniel.. INFOSOL Webmail http://webmail.gtm.sld.cu/imp/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Name searches for the spelling impaired
HI , Following php functions may be usefull http://www.php.net/soundex http://www.php.net/similar_text Just try to make good algoritham ;) Zareef Ahmed Pete Holsberg [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there a way to program MySQL so that it can find the name Smyth if the user looks for Smith? And similar mispellings that are similar in sound. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] how to show this querry
Hi , I have a problem with showing a query I have a table project with start date end date and project title I want to show only the projects that they are given in table for that month, for example project that starts 06-09-04 and ends 09-09-04 or ends 12-02-05 but nt the projects that starts 06-10-04 Any help will be appreciated -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to show this querry
try this SELECT start_date, end_date, project_title from tablename where month(start_date)=09 and year(start_date)=04 this will show only the data pertaining to 09 month and 04 year. hope this will resolve your problem. with best wishes balwant -Original Message- From: peppe [mailto:[EMAIL PROTECTED] Sent: Monday, September 06, 2004 2:45 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] how to show this querry Hi , I have a problem with showing a query I have a table project with start date end date and project title I want to show only the projects that they are given in table for that month, for example project that starts 06-09-04 and ends 09-09-04 or ends 12-02-05 but nt the projects that starts 06-10-04 Any help will be appreciated -- 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] how to show this querry
Hi Balwant your answer helpd me only I have a problem showing the projects starting 06-05-2004 and ending 09-09-2005 I need to show also those projects beacuse of end date is 2005 Balwantsingh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] try this SELECT start_date, end_date, project_title from tablename where month(start_date)=09 and year(start_date)=04 this will show only the data pertaining to 09 month and 04 year. hope this will resolve your problem. with best wishes balwant -Original Message- From: peppe [mailto:[EMAIL PROTECTED] Sent: Monday, September 06, 2004 2:45 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] how to show this querry Hi , I have a problem with showing a query I have a table project with start date end date and project title I want to show only the projects that they are given in table for that month, for example project that starts 06-09-04 and ends 09-09-04 or ends 12-02-05 but nt the projects that starts 06-10-04 Any help will be appreciated -- 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] functions via event handlers
i'd just luv to ask if it is possibble to call a function in PHP by using event handlers (like onmouseover, onload) as done in javascript? if its possible, i'd appreciate someone to tutor me on it. - A passion till tomorrow, www.opeyemi.tk - Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now.
Re: [PHP-DB] Re: Name searches for the spelling impaired
On Mon, 6 Sep 2004, David Robley wrote: On Mon, 6 Sep 2004 11:09, Pete Holsberg wrote: Is there a way to program MySQL so that it can find the name Smyth if the user looks for Smith? And similar mispellings that are similar in sound. The SOUNDEX string function in mysql may be what you want. http://dev.mysql.com/doc/mysql/en/String_functions.html Something like SELECT fields FROM table WHERE SOUNDEX(name) = SOUNDEX('searchvalue') Cheers -- David Robley Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Name searches for the spelling impaired
On Mon, 6 Sep 2004, Zareef Ahmed wrote: HI , Following php functions may be usefull http://www.php.net/soundex http://www.php.net/similar_text Just try to make good algoritham ;) Zareef Ahmed Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Newbie Questions
Well, I have this: $result=mysql_query('SELECT * FROM $table ORDER BY lastname, street, housenum ASC'); if u're trying to use variables like $table in the query (which i think u are), they need to be in double quotes : not single quotes. so the line should be: $result=mysql_query(SELECT * FROM $table ORDER BY lastname, street, housenum ASC); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Reload page on after sending data to mysql database
Hi, i´ve got a flash form that send inserted data to a page called insert.php and after sending data to the mysql database the page reloads the flash form for a new entry, but it reloads it on a new page i want to reloadit on the same page that i ´ve enter the previous entry. I´m posting the relevant parts of the php code: ?php //defino variables $apellidoclientesnuevos = $_POST['apellido']; $nombreclientesnuevos = $_POST['nombre']; $telefonoclientesnuevos = $_POST['telefono']; $dniclientesnuevos = $_POST['dni']; $fechacitaclientesnuevos = $_POST['fecha']; $horacitaclientesnuevos = $_POST['hora']; $abogadoclientesnuevos = $_POST['abogado']; $asuntoclientesnuevos = $_POST['asunto']; $dondeclientesnuevos = $_POST['donde']; $URL=http://www.myform.php;; //establece conección con el servidor y abre la base de datos $db = mysql_connect(90.0.0.2, javier, 315/95); mysql_select_db(clientes,$db); //manda query a la base de datos $sql = INSERT INTO clientesnuevos (1,2,3,4,5,6) VALUES ('$1','$2','$3','$4','$5','$6'); $result = mysql_query($sql) or die(Error in query: . mysql_error()); header (Location: $URL); exit; ? Any idea how can i do this?? Thanks Javier ___ 100mb gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Another newbie question
The following code results in the error message Couldn't execute query. --- ?php /* Program: ShowDir.php * Desc:Displays results of the search. */ ? html headtitleSearch Results/title/head body topmargin=0 marginheight=0 ?php include(login.inc); $connection = mysql_connect($host,$user,$password) or die (Couldn't connect to server); $db = mysql_select_db($database,$connection) or die (Couldn't select database); $sql = SELECT * FROM $table ; $sql .= WHERE `LastName` LIKE $search_string ; $sql .= OR `FirstName` LIKE $search_string ; $sql .= OR `Spouse` LIKE $search_string ; $sql .= OR `Street` LIKE $search_string ; $sql .= OR `Email` LIKE $search_string LIMIT 0, 30 ; $sql .= ORDER BY Street, HouseNum, LastName; $result = mysql_query($sql) or die (Couldn't execute query.); ... - Why is that? Also, how do I make LIKE insensitive to case? And finally, how do I use the % wildcard with a variable? Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Another newbie question
On Mon, 6 Sep 2004 [EMAIL PROTECTED] wrote: you should copy/paste that into a command-line msyql session and see if that works. I cut the query back to SELECT * FROM Directory WHERE `LastName` LIKE Joe ORDER BY Street, HouseNum, LastName and ran it manually. I got --- SQL-query : SELECT * FROM Directory WHERE LastName LIKE Joe ORDER BY Street, HouseNum, LastName LIMIT 0 , 30 MySQL said: Unknown column 'Joe' in 'where clause' Perhaps I don't understand LIKE. LastName is a column; Joe is a value. ??? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Another newbie question
I think you need to put '' around joe 'joe' Stuart --- Pete Holsberg [EMAIL PROTECTED] wrote: On Mon, 6 Sep 2004 [EMAIL PROTECTED] wrote: you should copy/paste that into a command-line msyql session and see if that works. I cut the query back to SELECT * FROM Directory WHERE `LastName` LIKE Joe ORDER BY Street, HouseNum, LastName and ran it manually. I got --- SQL-query : SELECT * FROM Directory WHERE LastName LIKE Joe ORDER BY Street, HouseNum, LastName LIMIT 0 , 30 MySQL said: Unknown column 'Joe' in 'where clause' Perhaps I don't understand LIKE. LastName is a column; Joe is a value. ??? -- 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] Another newbie question
--- Pete Holsberg [EMAIL PROTECTED] wrote: On Mon, 6 Sep 2004 [EMAIL PROTECTED] wrote: you should copy/paste that into a command-line msyql session and see if that works. I cut the query back to SELECT * FROM Directory WHERE `LastName` LIKE Joe ORDER BY Street, HouseNum, LastName and ran it manually. I got --- SQL-query : SELECT * FROM Directory WHERE LastName LIKE Joe ORDER BY Street, HouseNum, LastName LIMIT 0 , 30 MySQL said: Unknown column 'Joe' in 'where clause' Perhaps I don't understand LIKE. LastName is a column; Joe is a value. ??? On Mon, 6 Sep 2004, Stuart Felenstein wrote: I think you need to put '' around joe 'joe' Stuart Tried that. It said that 'Joe' was an unknown column! Besides, Joe is the value of a variable passed by another script. Thanks. -- 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 Form Validation help
have a form that I would like to validate before it is submitted to the DB. I am having trouble with a couple of sections. I have a select box with a listing of all the states, the first option is Choose One with a value of 0. Would this be the correct way to validate this field? CODE $state = $_POST['state']; if ($state = 0) { print 'pPlease select your State/p'; } /CODE Second, another part of the same form I have fields for phone numbers, once the field is submitted I would like to join the 3 sections of areacode, nxx and prefix. I have done this to join them, is this correct? CODE $phone = $_POST['p-areacode'] . - . $_POST['p-prefix']. - . $_POST['p-suffix']; /CODE The next question id for both phone number and area code. If I want to validate the zip code and ensure a minimum of X characters in the field, numbers only how would I do this? Would this be somewhat on the right track? CODE If ($zip str 5) { print 'pPlease enter your Zip Code (EX. 77662)/p'; } /CODE And for the phone number I would assume I could use: CODE If ($_POST['p-areacode'] str 3 ) { print 'pPlease enter your Area Code (EX. 77662)/p'; } /CODE I am still new with PHP, any help would be appreciated. Below is the code I have sofar:
Re: [PHP-DB] php Form Validation help
See below for point-by-point. ... CODE $state = $_POST['state']; if ($state = 0) { = is an assignment operator. This will always test true, because $state is set to 0 every time this is called. You want ==, which is a comparison operator. print 'pPlease select your State/p'; } /CODE CODE $phone = $_POST['p-areacode'] . - . $_POST['p-prefix']. - . $_POST['p-suffix']; /CODE More like: $phone = $_[PST[area] . - .. You get the idea -- dashes need to be surrounded by quotes. The next question id for both phone number and area code. If I want to validate the zip code and ensure a minimum of X characters in the field, numbers only how would I do this? You can check the string length and see if it's within the bounds you want. Look at the Strings section of the PHP manual for the proper function (str_len, I think). Would this be somewhat on the right track? CODE If ($zip str 5) { print 'pPlease enter your Zip Code (EX. 77662)/p'; } /CODE Nope. If someone entered 98115, then this would be 5, since there's a difference of 98110 integers :) And for the phone number I would assume I could use: CODE If ($_POST['p-areacode'] str 3 ) { print 'pPlease enter your Area Code (EX. 77662)/p'; } /CODE See comment on string length above. I am still new with PHP, any help would be appreciated. Below is the code I have sofar: Hope this helps. -- Peter Ellis - [EMAIL PROTECTED] Web Design and Development Consultant naturalaxis | http://www.naturalaxis.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] functions via event handlers
Yemi, On Sep 6, 2004, at 7:14 AM, Yemi Obembe wrote: i'd just luv to ask if it is possibble to call a function in PHP by using event handlers (like onmouseover, onload) as done in javascript? if its possible, i'd appreciate someone to tutor me on it. As far as I know, this is not possible. Since PHP is server-side scripting (not client-side like JavaScript), all the code-processing is done before it ever reaches the client's computer. Because of this, you will never be able to use the code via event handlers. If anyone knows something different, please let me and Yemi know. ~Philip -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] functions via event handlers
the closest you could come is to make javascript functions call php pages basically redirects that would call the php functions. -- Joseph Crawford Jr. Codebowl Solutions [EMAIL PROTECTED] 802-558-5247 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] functions via event handlers
Hi, A small example script language=javascript function call_me() { window.location=script.php; } /script div onmouseover=call_me() click me/div If you are thinking about some live experience like javascirpt with PHP you can go for flash and php. In Flash Event calls php scripts and get the value without reloading the flash movie. Zareef Ahmed --- Yemi Obembe [EMAIL PROTECTED] wrote: i'd just luv to ask if it is possibble to call a function in PHP by using event handlers (like onmouseover, onload) as done in javascript? if its possible, i'd appreciate someone to tutor me on it. - A passion till tomorrow, www.opeyemi.tk - Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. = Zareef Ahmed :: A PHP Developer in Delhi(India). Homepage :: http://www.zasaifi.com __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mySQL searching through serialized arrays
I am storing array of user IDs as TEXT using the serialize() function on the array, since several users, one or none can be part of each record... and I noticed that the serialized array has the values in double quotes like :21; for example... so since I know that the values will be enclosed, i am using the sql statement, with 21 as the example variable: SELECT FROM table WHERE userarray LIKE '%\21\%' is there a better way or a built-in mySQL function to filter through the serialized array -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php