RE: [PHP-DB] E-mail address verification

2002-06-20 Thread Gary . Every
I do it like this: if (eregi("^[a-z0-9]+([\.%!][_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$", $email)) { list($user, $host) = explode("@", $email); if ( !checkdnsrr($host, "MX") ) return TRUE; } else { return FALSE; } } As you can see, the email

[PHP-DB] MySQL Query Acting Up

2002-06-20 Thread Martin Clifford
Howdy all, If someone call tell me why this MySQL query is not working, I'd be VERY thankful. I don't see a damn thing wrong with it, but I could have been looking at it too long. Here is the query: $query = "UPDATE articles2 SET title=\"$title", brief=\"$brief\", doclink=\"$doclink\" WHERE

[PHP-DB] Re: MySQL Query Acting Up

2002-06-20 Thread user
in your SET title=\"$title\", statement you forgot the second backslash before the double quote. I would start there. Martin Clifford wrote: > Howdy all, > > If someone call tell me why this MySQL query is not working, I'd be VERY thankful. >I don't see a damn thing wrong with it, but I

[PHP-DB] Re: MySQL Query Acting Up

2002-06-20 Thread Seth Yount
in your SET title=\"$title\", statement you forgot the second backslash before the double quote. I would start there. Martin Clifford wrote: > Howdy all, > > If someone call tell me why this MySQL query is not working, I'd be VERY thankful. >I don't see a damn thing wrong with it, but

[PHP-DB] Re: MySQL Query Acting Up

2002-06-20 Thread Martin Clifford
Thanks everyone! Between all the replies I was able to locate the problem and fix it! It wasn't the missing backslash (that was a typo, which sucks). I wasn't properly passing the article_id field to the query, so MySQL had a problem with WHERE id="". Thanks again! :o) Martin -- PHP Datab

[PHP-DB] RE: SQL guru needed: Is this query possible ?

2002-06-20 Thread Max Sullivan
Nick, Thanks for the response. I think I understand what you are saying, but I wanted to try and get this to work with out adding another table if possible. I've got some help from the list and below is the query that seems to work without the need for another table. I guess that brings up ano

[PHP-DB] Can I be an ASP with PHP?

2002-06-20 Thread René Fournier
I have a question to which I'm pretty sure the answer will be "no", but I would like to hope I'm wrong... I've developed a very simple Content Management tool--called "Europa"--that even retarded monkeys can use to change/update text in their web site. It's web-based, user-authenticated (sessi

[PHP-DB] Re: Copy table

2002-06-20 Thread Andy
the easiest way would be if you install myphpadmin which is a awesome free mysql webadmin tool. You can get it at http://www.hotscripts.com/Detailed/7180.html Have fun, Andy -- http://www.globosapiens.net Global Travellers Network! "Rosen

[PHP-DB] Re: Resetting auto_incremented values

2002-06-20 Thread Andy
sorry buddy, as far as I know you can't. The only thing you can do is to set the counter higher but you can't return to a value under the given row. Please correct me if I am wrong, Andy -- http://www.globosapiens.net Global Travellers Netwo

[PHP-DB] Re: Resetting auto_incremented values

2002-06-20 Thread Daniel Brunner
Hello!! ALTER TABLE $table1 AUTO_INCREMENT = 3 Dan On Thursday, June 20, 2002, at 01:44 PM, [EMAIL PROTECTED] wrote: > sorry buddy, as far as I know you can't. > The only thing you can do is to set the counter higher but you can't > return > to a value under > the given row. > > Please co

Re: [PHP-DB] String datetime to DateTime

2002-06-20 Thread szii
Hmm...odd. I guess their %s (yes that was a typo) looks for a space as a delimiter and not the specified next one. Easiest workarounds off the cuff... 1) sscanf() to get the bulk of the data out, then regex out the %s string. 2) eregi_replace() Jun with the numeric 3) Dump it as numeric inste

[PHP-DB] Innodb and transactions.

2002-06-20 Thread Steve Bradwell
Hi all, I have just figured out and set up my Innodb on my mysql server so I can use transactions Begin, commit, rollback. I'm now looking for examples on how to do this with php. I hit the php site and the best I could find was fbsql_commit etc... is this what I'm looking for? There's no documen

[PHP-DB] Populating multi-select list from mysql

2002-06-20 Thread bob
Hi all, I'm having problems getting my multi-select list populated from a mysql table. There is a table called categories with 2 columns (id and category). I want to get all the items (category) and list them in the multi-select list box. This is the code I have so far: $sql = "SELECT category

Re: [PHP-DB] String datetime to DateTime

2002-06-20 Thread Glenn Holden
Thanks for the help I'm fairly certain a fancy preg_replace could do it all at once... (if you sit down and write it some late night, please share...) I didn't use the exact functions you suggested, not sure what the difference is (yet). Here's what I ended up with, it could easily be turned

[PHP-DB] Re: Can I be an ASP with PHP?

2002-06-20 Thread Glenn Holden
You'll need a table for each web site's connection parameters, but just look them up based on the user and plug them in to your mysql_connect() and mysql_select_db() arguments. As long as their tables match the structure you are expecting everything else should work. Voila! Good luck with your

[PHP-DB] How to Show my Own Error Message Instead of Mysql Error?

2002-06-20 Thread Jack
Dear all i made a Registration Form for user to input their Data, but i also had some Field Check before the data can be insert to the Mysql_Database! I had a question here, sometime the mysql shows the error : "Duplicate Key for xxx" I know what is this about, reguarding to my Registration Form,

[PHP-DB] RE: [PHP] How to Show my Own Error Message Instead of Mysql Error?

2002-06-20 Thread Martin Towell
what about doing a "select count(*) from table where username = 'foobar'" then, if ($cnt > 0) { /* display error */ } else { /* insert new username */ } -Original Message- From: Jack [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 2:07 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [

[PHP-DB] Converting values from text to numerical

2002-06-20 Thread Matthew Nock
I am about to build a database of products that will store features fore ach product in a separate table. I need to be able to store both text and numeric values in this table, but be able to perform mathmatical functions on the numeric variables. is it possible to have PHP covert numbers that a

RE: [PHP-DB] Converting values from text to numerical

2002-06-20 Thread Russ
"is it possible to have PHP covert numbers that are stored as text strings back into values it can calculate with?" Mathew: You can use PHP to convert these - dependant upon the way you store them in your DB. Foe example I sometimes need to store different types of data in the same field (I supp

RE: [PHP-DB] Converting values from text to numerical

2002-06-20 Thread Matthew Nock
Hi Russ, Thanks for the reply. I was looking more along the lines of having one field, that might store either a text value (such as the words "Not included"), or a numeric value, such as 10. The using PHP to determine if the value is numeric, perform a function on it (such as a calculation) th

RE: [PHP-DB] Converting values from text to numerical

2002-06-20 Thread Russ
Matthew: um how about using the is_int() function to decide if the value from your DB is a number or not? http://www.php.net/manual/en/function.is-int.php //Do DB extraction stuff to get $val/$vals from DB if(is_int($val)) { echo "This is a number so do numbery type things with it.

RE: [PHP-DB] Converting values from text to numerical

2002-06-20 Thread Matthew Nock
Hi Russ, thanks for the reply ... if that will evaluate whether a (in this case) a text string is an integer or not, then its exactly what I need! :) if it doesnt work, I will post a more detailed example to the list and see what we can come up with! :) -Original Message- From: Russ [m

RE: [PHP-DB] Converting values from text to numerical

2002-06-20 Thread Russ
sweet-as Russ -Original Message- From: Matthew Nock [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 1:15 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Converting values from text to numerical Hi Russ, thanks for the reply ... if that will evaluate whether a (in this case)

[PHP-DB] Re: Converting values from text to numerical

2002-06-20 Thread Andy
yes you can switch the type of var for examle with: $number = (integer)$textvar; But if you do store it as a textfield you want be able to do some special sql stuff directly in mysql. For example if you store the date as text in the db you want be able to filter out entries which are between x

RE: [PHP-DB] Re: Converting values from text to numerical

2002-06-20 Thread Matthew Nock
Hi All, upon looking at the link Russ gave me earlier... the PHP site recommends the use of is_numeric() function. This does exactly what I want.. there will only be numbers of text in the field. I can quickly run this returned result from the record through this function.. and if it is numer

Re: [PHP-DB] Innodb and transactions.

2002-06-20 Thread Michael Bretterklieber
Hi, you have to do something like this: mysql_query('SET AUTOCOMMIT=0'); mysql_query('COMMIT'); or mysql_query('ROLLBACK'); mysql_query('SET AUTOCOMMIT=1'); bye, Steve Bradwell schrieb: > Hi all, > > I have just figured out and set up my Innodb on my mysql server so I can use > transacti

[PHP-DB] a "back" include script

2002-06-20 Thread Dib, Walid (MED, Stagiaire GEMS)
Hello, I want to create a file include .inc which by calling it in almost all the pages which I use, will return me to the previous page, thus this script should have the same function as the back the button of the navigator, somebody has an idea of the script???. Thank you in advance.