at the moment if a value is say inserted into the 'warranty_info' table
you are just checking that the 'product_id' or 'cust_id' already exists
in 'product_info' and 'customer_info'. you still have to populate them
first, otherwise the referential integrity will return an error when you
insert
Hi all,
I am writing a PHP newsletter where users are able to write the news and
for the information to be written to 2 tables in the database. I can do
this for one table but it need it for 2.
Obviously what needs to happen if that the two ids from t1 and t2 be
linked together but how do i get
You can use the 'substr' function
$reduced_string = substr($str, 0, 60);
More info available at http://www.php.net/substr
Amit Arora
http://www.digitalamit.com
Cole Ashcraft wrote:
How would you reduce a string to a specified length? Say reduce 600 to
60 or abc to ab? Is there a PHP function for
Hi Cohen,
It´s really trivial. You show put a block that tests if a student is
selected, like
? if (strlen($_REQUEST[student_id])0) { ?
DO SOME STUFF
SCRIPT
/* And add this simple feature to select the student passed as parameter */
/* Assuming that the select is inside a form named 'f' */
To be honest, I'm not sure. I didn't write the script or the database, they
were written by the guy who worked there before me. I think the solution
presented to increase max time will work but if the hang time becomes too
great I will look into this suggestion.
Thanks!
-Lisi
At 09:50 AM
Hello,
I am getting an REG_BADRPT error when I use ereg.
The line of code that errors is:
if (!ereg('^(?=.*[0-9]+.*)(?=.*[a-zA-Z]+.*)[0-9a-zA-Z]{8,}$', $pass)){
I got this regex from regexlib.com and tried to impliment it, but no matter
what I do it always returns the error. I did a google
Are the messages with the subject line IMPORTANT: Please Verify Your
Message bogus? They do not come from the ezmlm mailer at lists.php.net.
They do not have the [PHP-DB] prefix. Have the owners of the list
requested this?
Cole
--
This message has been scanned for viruses and
dangerous content
On Mon, 19 Jul 2004 07:47:38 -0700, Cole S. Ashcraft
[EMAIL PROTECTED] wrote:
Are the messages with the subject line IMPORTANT: Please Verify Your
Message bogus? They do not come from the ezmlm mailer at lists.php.net.
They do not have the [PHP-DB] prefix. Have the owners of the list
Hello,
Ive been trying a few things and finally I did get rid of the error. I
changed the code to:
if (!ereg('^(!?=.*[0-9]+.*)(!?=.*[a-zA-Z]+.*)[0-9a-zA-Z]{6,}$', $pass)){
Notice the ! before the two ?
This got rid of the error, but it still isnt working the way I want it to.
That line
In this case, it seems like you're looking for a lot of different and
exclusive things at once. I would suggest not using a huge regex as
they can be hard to create, harder to read, and impossible to
maintain. That said, I do use regexes in some of my code, just not for
something this simple. ;-)
Thanks for the help. Being new to PHP I was unaware that I could use some
perl compatible regexes here. That will help me out a lot.
Thanks again,
Aaron
Justin Patrin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
In this case, it seems like you're looking for a lot of different
I am just starting out with PHP and I have created a simple login program
that is supposed to check users input with a mysql database. I am doing 5
verifications before the program is completed...Check for the Submit button,
check for a valid email address(which is the username), check for a
if you have shell access, please do the following
describe users;
select * from users;
also, why are you using LIKE instead of =?
use this instead:
$query = SELECT * FROM users WHERE email = '.$username.';
i would also suggest turning off register globals and using
$_POST['username'] and not
I got this email today. Is php doing this? Is this email ligitimate?
On Mon, 19 Jul 2004 09:55:58 -0400, [EMAIL PROTECTED],
[EMAIL PROTECTED]
p.net said:
Hello [EMAIL PROTECTED] ,
[EMAIL PROTECTED], [EMAIL PROTECTED] is currently
protecting themselves from receiving junk mail using
Jon,
Thanks for the info. I did change the LIKE to =. This was done just for my
debugging. I do have it set to = on a normal basis.
I am a little unsure what you mean at the end of your reply about register
globals. Are you saying that everywhere I use $username to refer to the
users inputed
Hello,
Since I migrated to the PHP 4.3.7 I have a major warning problem which
appears from time to time and I cannot find the message explanation or a fix
to this issue with both old tables and new created tables.
The error message is:
[19-Jul-2004 20:00:27] PHP Warning: mysql_query(): Your
You should generally $_POST for all posted variables, $_GET for all
get variables (in the query string / url), and the other
superglobals for other such things. If you don't care if it's POST,
GET, or a cookie, you can use $_REQUEST.
register_globals is a setting in your php.ini. It's best
PLEASE look at the previous messages about this.
Yes, it's legit.
No, it's not the PHP lists sending it to you.
On Mon, 19 Jul 2004 10:24:27 -0700, Marcjon [EMAIL PROTECTED] wrote:
I got this email today. Is php doing this? Is this email ligitimate?
On Mon, 19 Jul 2004 09:55:58 -0400, [EMAIL
You want to use $_POST['username'] instead of $username everywhere you
have a POST variable. I believe this became the standard around PHP4.2.
Can you give us the table def and the results of that select? Also, can
you copy that query ( echo $querybr;) into your next reply?
I think you're
That makes great sence, however when I tried using $_POST in my SQL
statement it would not work.
This works fine:
$query = SELECT * FROM users WHERE email='.$username.';
But this one doesnt at all:
$query = SELECT * FROM users WHERE email=',$_POST['username'],';
It does however work for all the
Thanks to everyone so far who has responded, but the other posts are going
down a different road than what I currently need.
In my code below I am building a login page. I am continuing to do
different things to debug this problem myself and I think I have narrowed it
down a bit. Like I said in
Jon,
The table contains 2 fields...email and pass. My plan is to use the email
address as the username.
$query = SELECT * FROM users WHERE email='.$username.';
I used this query because a persons whole email address should be unique. I
didnt feel it was necessary to add the AND password=
Trade in those commas around your $_POST['username'] for some periods.
Rich
-Original Message-
From: Aaron Todd [mailto:[EMAIL PROTECTED]
Sent: Monday, July 19, 2004 2:08 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Begining PHP...Have Questions
That makes great sence,
Hello Aaron,
why are you using , instead of . ?
$query = SELECT * FROM users WHERE email=',$_POST['username'],';
is this a typo?...
this sould be:
$query = SELECT * FROM users WHERE email='.$_POST['username'].';
or $query = SELECT * FROM users WHERE
On Mon, 2004-07-19 at 14:08, Aaron Todd wrote:
That makes great sence, however when I tried using $_POST in my SQL
statement it would not work.
This works fine:
$query = SELECT * FROM users WHERE email='.$username.';
But this one doesnt at all:
$query = SELECT * FROM users WHERE
Correct me if I am wrong
But shouldn't the if statement be
if (!$_POST['passw'] == mysql_result($result,0,pass)){
not
if (!$_POST['passw'] = mysql_result($result,0,pass)){
Two equal signs not one...
Regards,
Neal
-Original Message-
From: Hutchins, Richard [mailto:[EMAIL
That explains it. I did look at the manual and it did show . instead of ,
It just didnt even hit me. One of those kick yourself mistakes.
Thanks,
Aaron
Pablo M. Rivas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hello Aaron,
why are you using , instead of . ?
But has that change (commas to periods) addressed the original problem you
posted regarding the code not returning the results you expect?
Rich
-Original Message-
From: Aaron Todd [mailto:[EMAIL PROTECTED]
Sent: Monday, July 19, 2004 3:14 PM
To: [EMAIL PROTECTED]
Subject: Re:
Hello,
Is anyone familiar with what would cause an error like this:
Warning: Statement isn't valid anymore in includes\import.inc.php on
line 810
I'm using MySQL 4.1.2a, PHP 5.0.0 with Apache 2.0.50. All tables are
InnoDB format.
The calling function is:
function insert_phone($ContactID) {
I think I may have gone over my head. I am fairly new to mysql and php.
My host only allows access to mysql via phpmysql. I am used to using
mysqlcc to connect to the db's and make changes. By default all tables
created are MYISAM, when I try to input a INNODB table with foreign keys
I either get
Gilmore, Corey (DPC) wrote:
Is anyone familiar with what would cause an error like this:
Warning: Statement isn't valid anymore in includes\import.inc.php on
line 810
1. Which line is 810? That's going to really help someone determine why
you may be getting this warning.
2. This is a warning,
John Holmes wrote:
Gilmore, Corey (DPC) wrote:
Is anyone familiar with what would cause an error like this:
Warning: Statement isn't valid anymore in includes\import.inc.php on
line 810
1. Which line is 810? That's going to really help someone determine why
you may be getting this
I have a form to insert customer data into a table. The form goes to php
page to input data to db hen uses header to go to a final page
displaying customer's information.
Is there a way to get the ID (custid PK UNIQUE AUTO_INCREMENT) from
mysql after INSERT then pass to final page using urlencode
On Tuesday 20 July 2004 10:09, Vincent Jordan wrote:
Is there a way to get the ID (custid PK UNIQUE AUTO_INCREMENT) from
mysql after INSERT then pass to final page using urlencode to pull cust
record?
manual MySQL Functions
--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source
I have a form to insert customer data into a table. The form goes to
php
page to input data to db hen uses header to go to a final page
displaying customer's information.
Is there a way to get the ID (custid PK UNIQUE AUTO_INCREMENT) from
mysql after INSERT then pass to final page using urlencode
I have a mySQL DB running on an NT server.
I just re-installed it (long story) and everything seems to be fine, except
DB access.
// Connectivity data
$db_engine = 'mysql';
$db_host = 'db.myserver.net';
$db_user = 'test';
$db_pass = 'test';
$db_name = 'test';
On Tuesday 20 July 2004 13:16, \[php\]Walter wrote:
I have a mySQL DB running on an NT server.
$db_host = 'db.myserver.net';
Now, if I change $db_host to the machine IP, it works fine.
If db.myserver.net does not resolve to a sensible IP address add it to your
HOSTS file. Or setup
37 matches
Mail list logo