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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
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];
[
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
"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
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
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.
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
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)
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
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
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
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.
27 matches
Mail list logo