Re: [PHP] Is there a special character I here?
I use a javascript to do that for my forms: if (window.RegExp) { var reg = new RegExp("^[_0-9a-z]*$","gi"); if (!reg.test(f.elements['username'].value)) { alert("Kullanici adi harf ve/veya rakamlardan olusmalidir. Lutfen Duzeltiniz!"); f.elements['username'].focus(); return(false); } } I am sure you could write something similar with PHP. --- Brandon Orther <[EMAIL PROTECTED]> wrote: > Hello, > > I am looking for a way to check a string if it has > anything other than > Numbers or Letters. Does anyone know how to do this? > Thank you, > > > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > > > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] Startup
Hello All, I receive the following warning message. When I reload the page, the message is the error message does not show up again. Funny thing is, that there are other parts of the page generated from the same database using the same mysql_pconnect and they are fine. I am using a standard $sql mysql_query($sql) mysql_fetch_array($result) kind of command, nothing too fancy. Did anybody have a similar experince? Warning: Supplied argument is not a valid MySQL result resource in /xxx/xxx//index.php on line 45 thanks. Roman <[EMAIL PROTECTED]> wrote: I install apache 1.3.20, php 4.0.6 and mysql on Red Hat Linux 7.0 but I must start thei manualy. I want to start this services automatically when starts the linux. How ? roman -- PHP General 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] Mehmet Erisen http://www.erisen.com - Do You Yahoo!? Make international calls for as low as $0.04/minute with Yahoo! Messenger.
[PHP] MySQL Error.
Hello All, I receive the following warning message. When I reload the page, the message is the error message does not show up again. Funny thing is, that there are other parts of the page generated from the same database using the same mysql_pconnect and they are fine. I am using a standard $sql mysql_query($sql) mysql_fetch_array($result) kind of command, nothing too fancy. Did anybody have a similar experince? Warning: Supplied argument is not a valid MySQL result resource in /xxx/xxx//index.php on line 45 thanks. Roman wrote: I install apache 1.3.20, php 4.0.6 and mysql on Red Hat Linux 7.0 but I must start thei manualy. I want to start this services automatically when starts the linux. How ? roman -- PHP General 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] Mehmet Erisen http://www.erisen.com - Do You Yahoo!? Make international calls for as low as $0.04/minute with Yahoo! Messenger. Mehmet Erisen http://www.erisen.com - Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: [PHP] Adding records to a MySql database
In adition to that, you may want to check out the online documentation on the www.php.net website. Find the section under mySQL. If you know how to manipulate data using SQL, php apis are very easy to use .. www.mysql.com could be good resource for you as well. if you have a specific question in mind, fire it away!!! Erisen --- Martín Marqués <[EMAIL PROTECTED]> wrote: > On Vie 17 Ago 2001 19:17, you wrote: > > I am new to MySql but wanting to use PHP to update and > maintain a database. > > I thought I might use MySql. > > > > I have installed MySql, and in PHP have created a > database called 'mydir'. > > I am trying to find php functions to add new > records/fields to the > > database, but all I can find are functions to query and > get information > > from a database. > > You should first learn howto use an SQL database, and > after that think about > using it. Read the MySQL tutorial. It's somewhrere in > there web site. > > Saludos... :-) > > -- > Porqué usar una base de datos relacional cualquiera, > si podés usar PostgreSQL? > - > Martín Marqués | > [EMAIL PROTECTED] > Programador, Administrador, DBA | Centro de > Telematica >Universidad Nacional > del Litoral > - > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] SESSION question.
Hello, I have implemented a user login with PHP Session functions. THe problem I have is that if the user is logged in the site using http://mysite.com/login.php and starts a session, the session is not recognized when user is trying to utilize the site with http://www.mysite.com/dosomething.php any suggestions? thanks, erisen. ultrAslan. = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] Adding records to a MySql database
Hello, I am using the PHPMyAdmin for that. There is a website www.phpwizard.net that you can download phpMyAdmin. Hope this helps. Mehmet. --- "Dave.O" <[EMAIL PROTECTED]> wrote: > I have read the documentation already. > > I am trying to create a directory, which information can > be added and > maintained through a the web browser. I thought that > using a MySql database > would be a good idea rather than writing it all to a > file. You saying that > MySql is a waste of time for this ? > > I thought that PHP can be used to add records etc and > query databases for > this > > > > Dave > > - Original Message - > From: "Martín Marqués" <[EMAIL PROTECTED]> > To: "Dave.O" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Friday, August 17, 2001 11:28 PM > Subject: Re: [PHP] Adding records to a MySql database > > > > On Vie 17 Ago 2001 19:17, you wrote: > > > I am new to MySql but wanting to use PHP to update > and maintain a > database. > > > I thought I might use MySql. > > > > > > I have installed MySql, and in PHP have created a > database called > 'mydir'. > > > I am trying to find php functions to add new > records/fields to the > > > database, but all I can find are functions to query > and get information > > > from a database. > > > > You should first learn howto use an SQL database, and > after that think > about > > using it. Read the MySQL tutorial. It's somewhrere in > there web site. > > > > Saludos... :-) > > > > -- > > Porqué usar una base de datos relacional cualquiera, > > si podés usar PostgreSQL? > > > - > > Martín Marqués | > [EMAIL PROTECTED] > > Programador, Administrador, DBA | Centro de > Telematica > >Universidad Nacional > > del Litoral > > > - > > > > -- > > PHP General 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 General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] Adding records to a MySql database
Here is how this is done: $sql = "insert into employees values ('10','John','Smith','Engineer') "; $result = mysql_query($sql) or die ('Insert failed'); with php, you can execute any SQL statement as long as you have access... to update a table $sql = "update employees set job = 'Chief Engineer' where employee_id = '10' "; $result = mysql_query($sql) or die ('Update failed'); hope this helps, ultrAslan --- "Dave.O" <[EMAIL PROTECTED]> wrote: > I was looking for the command something like mysql_insert > or something, just > found dba_insert() is this it ?!? > > - Original Message - > From: "Martín Marqués" <[EMAIL PROTECTED]> > To: "Dave.O" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Saturday, August 18, 2001 12:23 AM > Subject: Re: [PHP] Adding records to a MySql database > > > > On Vie 17 Ago 2001 20:14, Dave.O wrote: > > > I have read the documentation already. > > > > > > I am trying to create a directory, which information > can be added and > > > maintained through a the web browser. I thought that > using a MySql > > > database would be a good idea rather than writing it > all to a file. You > > > saying that MySql is a waste of time for this ? > > > > > > I thought that PHP can be used to add records etc and > query databases > for > > > this > > > > You said that all you found were functions to query > information. Thats all > > you need with an SQL database. > > The main SQL query commands are: SELECT, UPDATE, DELETE > and INSERT. With > > those 4 comands you can read, insert and modify (also > delete) the > information > > on your database. > > > > Hope you understand know. > > > > Saludos... :-) > > > > -- > > Porqué usar una base de datos relacional cualquiera, > > si podés usar PostgreSQL? > > > - > > Martín Marqués | > [EMAIL PROTECTED] > > Programador, Administrador, DBA | Centro de > Telematica > >Universidad Nacional > > del Litoral > > > - > > > > -- > > PHP General 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 General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] Is this a bug?
you are right. I tested with 99644xxx and 964 It printed A. However, if you are down to 644xxx is prints B which is correct. Perhaps a limitation of 16 digits. ? good catch --- Ratko <[EMAIL PROTECTED]> wrote: > Please try this: > echo "996448234192168122"=="996448234192168125"; > ?> > > I get "true" as a result. How's that possible? > But if I do: > echo "996448234192168122"==="996448234192168125"; > then I get "false" as expected. > > php 4.0.6, Debian Potatoe Linux. > > Does this happen only on my computer? > > > thanks, > ratko > > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] how expensive is Image functions?
Hello All, How expensive are the image functions as far as the system resources go. Would it be too expensive to use php to create simple gifs like buttons, tabs etc. Thanks, Erisen ulrAslan. = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] mySql_fetch_array($result) question.
Hello All, Another question. Here is the problem: - One SQL query - 1 result. I have a form that has more than one drop down lists. I like to use the mysql_fetch_array($result) to populate the select options. The problem is that after the first use, the mysql_fetch_array($result) does not return anything. Any suggestion. note: As a workaround, I am running the select statement (The SQL) 10 time. I think it's not a good solution though!! Thanks, Mehmet. = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] GET method and forms....
instead of method="GET" use method="POST" --- Seb Frost <[EMAIL PROTECTED]> wrote: > how do I prevent getting &submit=shop%21 in the url > window? > > > Email address: size="20"> > name="submit"> > > > - seb > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] numrows
Hello, Chris, with all due respect, DESC is a reserved word for SQL. is english ORDER BY ID DESC meand sort by id in descending order. Martin, your SQL seems to be fine. Are you sure that you are connected to your database. I have run the following SQL against my database SELECT * FROM users WHERE username <> '1' AND user_id < 250 ORDER BY user_id DESC and it returned back records. SO SQL syntax is fine. --- Chris Fry <[EMAIL PROTECTED]> wrote: > Should be ORDER BY ID, DESC > > Chris > > Martin Kampherbeek wrote: > > > What's wrong with this? I get the error: Warning: > Supplied argument is not a valid MySQL result resource in > /home/sites/site49/web/vragen/vragen.php on line 42 > > > > $query = "SELECT * FROM question WHERE answer<>'1' AND > id>250 ORDER BY id DESC"; > > > > $result = MYSQL_QUERY($query); > > > > $number = MYSQL_NUM_ROWS($result); > > -- > > Chris Fry > Quillsoft Pty Ltd > Specialists in Secure Internet Services and E-Commerce > Solutions > 10 Gray Street > Kogarah > NSW 2217 > Australia > > Phone: +61 2 9553 1691 > Fax: +61 2 9553 1692 > Mobile: 0419 414 323 > eMail: [EMAIL PROTECTED] > http://www.quillsoft.com.au > > You can download our Public CA Certificate from:- > https://ca.secureanywhere.com/htdocs/cacert.crt > > ** > > This information contains confidential information > intended only for > the use of the authorised recipient. If you are not an > authorised > recipient of this e-mail, please contact Quillsoft Pty > Ltd by return > e-mail. > In this case, you should not read, print, re-transmit, > store or act > in reliance on this e-mail or any attachments, and should > destroy all > copies of them. > This e-mail and any attachments may also contain > copyright material > belonging to Quillsoft Pty Ltd. > The views expressed in this e-mail or attachments are the > views of > the author and not the views of Quillsoft Pty Ltd. > You should only deal with the material contained in this > e-mail if > you are authorised to do so. > > This notice should not be removed. > > > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] PHP / MySQL Hosting Charges
Hello All, I think for a thin page with PHP+mySQL you can go as low as $3 a month (35MB) I have seen decent packages, with Vserver privileges at around $18/mnt. --- Alnisa Allgood <[EMAIL PROTECTED]> wrote: > At 4:09 PM +1000 8/24/01, Chris Aitken wrote: > >Hi All, > > > > > >Just a quick non-technical question. > > > >I live in Australia and a friend of mine has a website > hosted here > >in Oz, and he pays his set amount per month which simply > is for > >Hosting, cgi-bin and log file access for his website. > > > >Hes wanting to have the ability to use PHP and MySQL on > his site and > >his provider has quoted him the cost to add to his > current monthly > >charges to give him a MySQL username/password/database > and PHP > >ability. > > > >Both he and I feel its a bit pricey for what they want > to charge so > >I figured I would ask the list to see what other people > consider a > >reasonable price to add PHP and MySQL access to his > current > >www/cgi-bin/logs website. > > > Personally, I've always dealt with ISPs that offer PHP > and MySQL as > part of the basic monthly web hosting cost, which I > generally expect > to run between $20-$50 per month, depending on amount of > space > provided, backbone of the provider, and other variables. > > Can PHP be offered as an add-on, I thought it was either > or not, but > anyway... I've seen others pay separately for MySQL > access. I would > expect to pay between $5-$15 more per month, if it was a > separate > item. > > Alnisa > -- >. > Alnisa Allgood > Executive Director > Nonprofit Tech > (ph) 415.337.7412 (fx) 415.337.7927 > (url) http://www.nonprofit-techworld.org > (url) http://www.nonprofit-tech.org > (url) http://www.tech-library.org >. > Nonprofit Tech E-Update > mailto:[EMAIL PROTECTED] >. > applying technology to transform >. > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] limit 1
This is a sql question: Limit is limiting number of records that will come out of query. So, it would not work. SELECT users.names FROM users, selection Where users.name = selection.name and setting = 'on' ; you could use SELECT DISTINCT users.names FROM users, selection Where users.name = selection.name and setting = 'on' ; or SELECT users.names FROM users, selection Where users.name = selection.name and setting = 'on' group by users.names --- Jeremy Morano <[EMAIL PROTECTED]> wrote: > > Hi, > > > I wondering if it was possible to use limit on part of a > query and not all. > > > > > this is my query which works the way it should. > > $sql = "SELECT users.names > FROM users, selection > Where users.name = selection.name and setting = > 'on' > "; > > > > > What I would like to do is put a limit of 1 to only this > part -> setting > = 'on' limit 1 <--- and not on the rest. > > You see, there are many users.name that have a setting = > 'on'I > want, ALL those names , ONLY once.. > > How do I do this? > > > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] PHP/mySQL query problem...
Yes, there is a problem. -- SELECT * FROM links WHERE 1=1 and ( name LIKE "%te%" OR description LIKE "%te%" OR url LIKE "%te%" ) AND approved="1" LIMIT 5; -- --- Jeff Lewis <[EMAIL PROTECTED]> wrote: > Guys, why isn't this working? :) > > SELECT * FROM links WHERE name LIKE "%te%" OR description > LIKE "%te%" OR url LIKE "%te%" AND approved="1" LIMIT 5 > > I am using a PHP script to add items to the database and > a small search file to grab them. Thing is, I want the > above to grab ONLY ones that have approved = 1. In the > database they are all = 0. Is there a problem with my > SQL query? > > Jeff > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] clause
Hello Jeremy, you are using two tables, but you are not joining them. What's you goal? --- Jeremy Morano <[EMAIL PROTECTED]> wrote: > Hi, > > Can somebody help me out? > My where clause is completely being ignored. > More specifically the <>. I tried to use != and that > didn't work either. > However, when I substitute it with an = , It fuctions > correctly. > > Right now, the output is all the users.uid and all the > users.username from > the table users. > H E L P ! > > > > $connection = @mysql_connect("l", "c", "c") or > die("Couldn't connect."); > > $db = @mysql_select_db($db_name, $connection) or > die("Couldn't select > database."); > > $sql = "SELECT distinct users.uid , users.username > FROM users, picks > WHERE picks.users_uid <> users.uid > "; > > $result = @mysql_query($sql,$connection) or die("Couldn't > execute query."); > > > while ($row = mysql_fetch_array($result)) { > $uid = $row['uid']; > $username = $row['username']; > > $option_block .= " value=\"$uid\">$username"; > } > > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] clause
HEllo, I think this will better work. What Jeremy wants to do is to OUTER joing the tables: SELECT distinct users.uid , users.username FROM users LEFT OUTER JOIN picks using(uid) may do the trick. If you say letf join and the use ids not equal in the where, then I think it's same as saying: where uid = pid and uid != pid and will always be false. REF: http://www.mysql.com/doc/J/O/JOIN.html --- Andrey Hristov <[EMAIL PROTECTED]> wrote: > I don't know if this will help but why not to try > $sql = "SELECT distinct users.uid , users.username > FROM users LEFT JOIN picks USING(uid) > WHERE picks.users_uid <> users.uid > > Andrey Hristov > IcyGEN Corporation > http://www.icygen.com > 99% > > - Original Message - > From: "Jeremy Morano" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, August 27, 2001 9:52 PM > Subject: [PHP] clause > > > > Hi, > > > > Can somebody help me out? > > My where clause is completely being ignored. > > More specifically the <>. I tried to use != and that > didn't work either. > > However, when I substitute it with an = , It fuctions > correctly. > > > > Right now, the output is all the users.uid and all the > users.username from > > the table users. > > H E L P ! > > > > > > > > $connection = @mysql_connect("l", "c", "c") or > die("Couldn't connect."); > > > > $db = @mysql_select_db($db_name, $connection) or > die("Couldn't select > > database."); > > > > $sql = "SELECT distinct users.uid , users.username > > FROM users, picks > > WHERE picks.users_uid <> users.uid > > "; > > > > $result = @mysql_query($sql,$connection) or > die("Couldn't execute query."); > > > > > > while ($row = mysql_fetch_array($result)) { > > $uid = $row['uid']; > > $username = $row['username']; > > > > $option_block .= " value=\"$uid\">$username"; > > } > > > > > > -- > > PHP General 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 General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] double check query statement??
Hi it may sound funny, but you may want to add a space at the end of lines before ". I mean $query = "SELECT mpn_job.ID, job, assigned_to, status_date, category "; $query .= "FROM mpn_job, mpn_job_category WHERE CID = mpn_job_category.ID "; $query .= "AND category = '$category'"; also echo $query; before you run the php page to see the sql. I think your $query is like SELECT mpn_job.ID, job, assigned_to, status_date, categoryFROM mpn_job, mpn_job_category WHERE CID = mpn_job_category.IDND category = '$category' now, and it willl not run! /mehmet/ --- Gerard Samuel <[EMAIL PROTECTED]> wrote: > $query = "SELECT mpn_job.ID, job, assigned_to, > status_date, category"; > $query .= "FROM mpn_job, mpn_job_category WHERE CID = > mpn_job_category.ID"; > $query .= "AND category = '$category'"; > $result = mysql_query($query); > $row = mysql_fetch_row($result); > foreach ($row as $data) { > echo "$data[0]"; > } > > I tried the SELECT statement from mysql command line > (less $category, I > used an actual category name) and it works there. I try > it out in php, > and I get nothing. (I echoed $category before this and > it works > correctly) Do you guys see anything in there that may > need correcting? > Thanks. > > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] Re: Count()
$sql = "SELECT COUNT(*) AS myCount FROM Products"; $result = mysql_query($sql); $count = mysql_result($result,0); --- Kevin P <[EMAIL PROTECTED]> wrote: > I have counted some rows in MySQL and I need to know how > to pull out the > number of rows. > "SELECT COUNT(*) AS myCount FROM Products" > > > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General 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] fix my query please
Hello Jeremy, Two things: FROM users LEFT OUTER JOIN picks using(id) > Where users.uid <> picks.user_id 1- when you do OUTER join, you do NOT have to use the <>. That's what outher join means. 2- what is id? Is it a column? shouldn't it be uid? Maybe that's your problem. --- Jeremy Morano <[EMAIL PROTECTED]> wrote: > an somebody please fix up my query. > > > > > $connection = @mysql_connect("l", "c", "c") or > die("Couldn't connect."); > > $db = @mysql_select_db($db_name, $connection) or > die("Couldn't select > database."); > > > > $sql = "SELECT distinct users.uid , users.username > FROM users LEFT OUTER JOIN picks using(id) > Where users.uid <> picks.user_id > "; > > > > $result = @mysql_query($sql,$connection) or die("Couldn't > execute query."); > > > while ($row = mysql_fetch_array($result)) { > $usersleft = $row['username']; > $uid = $row['uid']; > > $my_string="$usersleft"; > > echo $my_string; > } > > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General 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] sql query with join and same column twice...
Please try select dest.dest_name, air.name as airport1, air2.name as airport2 from destination, airport air, airport air2 where dest.airport_dep_id_id=air.airport_id and dest.airport_arr_id=air2.airport_id; you can use the same table as manu times as you like in sql. It's calld a self join if my memory does not fail me. --- Web Manager <[EMAIL PROTECTED]> wrote: > Hello, > > Here are 2 tables: > > airport > - > airport_id > name > code > city_id > > > destination > --- > destination_id > dest_name > airport_dep_id // using airport.airport_id (departure) > airport_arr_id // using airport.airport_id has well > (arrival) > > > I have 2 columns in the second table that uses the same > name column in > the first table... > > I dont know how to formulate my SQL query... I want to > select the > destinations in the destination table with not the ID of > each airport > but their names. I can do a join with one but with the > second one, I get > no results... And this is confusing! > > select dest.dest_name, air.name as airport1, air.name as > airport2 from > destination, airport air where > dest.airport_dep_id_id=air.airport_id and > dest.airport_arr_id=air.airport_id; > > This is not good... > > Any help? > > Thanks! > -- > Marc Andre Paquin > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General 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] Chat / IRC
HEllo, Did anybody have a luck with a good Chat Program.? Thanks, Mehmet. = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General 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] GOOD web hosting
Hello, You may want to check out connecticut-web.com I use their $36/year plan for several domains. They are always up and running. They provide mysql+php support. --- Jason Bell <[EMAIL PROTECTED]> wrote: > I recently moved all of my domains to www.prohosters.com > and have been > nothing but pleased with them. > > They offer unlimited (within reason): > space (their plans list disk quotas but they will be > the first to tell > you that they ignore them) > pop3 accounts > MySQL Databases > Domain Names. (I have 4 domains, under one $15 > hosting account) > usernames. (Why is this usefull? Of my 4 domains, I > manage 2, and my > wife manages 2... we each have seperate usernames to keep > things seperate. Could also work if you wanted to resell > bandwidth) > 100 Unique IP Addresses (one time charge of $1 per > for every IP after > the initial 100) > PHP3 & 4 > Custom DNS. > Your Choice of UNIX or Windows 2k Hosting. > Global CGI access > No setup fee > And much much more > > but the best thing about them is their support... their > support is available > 24/7 via ICQ/AIM/Yahoo/IRC. They do whatever they can to > keep you happy. > > Their pricing is based on bandwidth usage, and starts out > at $15 a month for > 5Gig of data transfer. They run their servers as a > cluster for high > performance and availability the MySQL server is > seperated from the > HTTP server, and they have a seperate server for report > generation... > > if you want a "Hey! look! If they can handle *THAT* site, > they can handle > mine" type of example, they are the people who host > www.stileproject.com > > > > - Original Message - > From: "Seb Frost" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, September 04, 2001 3:58 PM > Subject: [PHP] GOOD web hosting > > > > I thought I had good web hosting, but I don't. They're > often very slow > and > > frequently (I'd say at least an hour every day) my site > is inaccessable. > > Today I've barely been able to get on it at all. > > > > So I'm moving. > > > > I'm in the UK. Is it stupid for me to go with a US > hoster? And either > way > > who do you recommend? Obviously I want php and mysql > support, and a few > > hundred megs of space, and NOT paying through the roof. > $20/month tops. > > > > - seb > > --- > > Outgoing mail is certified Virus Free. > > Checked by AVG anti-virus system > (http://www.grisoft.com). > > Version: 6.0.274 / Virus Database: 144 - Release Date: > 23/08/2001 > > > > > > -- > > PHP General 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 General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General 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] accessing a global in a function???
I have seen people using include ("config.php"); in the begining of the page for that purpose. --- Aaron Moore <[EMAIL PROTECTED]> wrote: > Sorry about the newbie question. I have a config.php file > which contains a > string which I would like a function to access. How do i > make it global so > that it can do so. > > Thanks for your help > > > > -- > PHP General 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General 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] Trunkated zeros..... how to fix?
use zerofill for the column when you create the table! --- "Dallas K." <[EMAIL PROTECTED]> wrote: > I am having the problem that Mysql is truncating the > zeros from both the int and char fields when I try to > insert How can I fix this. > > example: > > 0123 in PHP = 123 in mysql > 3210 in PHP = 321 in mysql > > but I need that zero how do I keep mysql from doing > this? > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General 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]