Re: [PHP-DB] value error in PHP form

2004-06-24 Thread Rinku
Thanks Zak, Its really amazing. It worked Properly. Thanks once again. Rinku Zachary Krakov <[EMAIL PROTECTED]> wrote: Hi Rinku, The statement syntax that I believe will work you is the following: If (($VARIABLE1 !== '') && ($VARIABLE2 !== '')) { print "Rinku"; } Let me know if this

RE: [PHP-DB] Date help needed

2004-06-24 Thread Chris Payne
Hi there, >A drop down with 365 days !?!? Isn't that a "little" big? Actually it's Fridays, Sundays and Tuesdays for 2 years (365 was an example) it's for an Admin for a client, and he asked that it be in a dropdown box and he's the boss, so he gets what he wants :-) One thing he wanted which

Re: [PHP-DB] SSL with MySQL 4.0

2004-06-24 Thread Cole S. Ashcraft
Is there such thing as SSL connections to MySQL? Edgar Hassler wrote: Does PHP support SSL connections to MySQL? If no, does anyone have an idea how to make an SSL conncetion to MySQL using PHP? Thanks, Edgar Hassler -- This message has been scanned for viruses and dangerous content by Mail

[PHP-DB] RE: Subject: Update data problem

2004-06-24 Thread Justin.Baiocchi
Hi Neil, I have tried it like that with no luck, what is below just happens to be my latest attempts to get it working. What is happening is that it is saying that $C and $G are zero, when in fact there is data in there. How do I get it to 'refresh' the variables? That is what I am trying to do

Re: [PHP-DB] Date help needed

2004-06-24 Thread Daniel Clark
A drop down with 365 days !?!? Isn't that a "little" big? > I have a problem, I currently have some code which populates a dropdown > box > - this code gives me every day for the next x amount of days (EG: a years > worth of days), however what I really need to be able to do, is to find a > way

Re[2]: [PHP-DB] help with consecutive numbers in db

2004-06-24 Thread Pablo M. Rivas
Hello Pablo, I made a Typo: change this: while ($key<80) echo "$lastgroup." . ($key++) . " is free\n"; for this: while ($key<255) echo "$lastgroup." . ($key++) . " is free\n"; ;) -- Best regards, Pablo -- PHP Database Mailing List (http://www.php.net/) To unsu

Re: [PHP-DB] help with consecutive numbers in db

2004-06-24 Thread Pablo M. Rivas
Hello redhat, Hey... look at this: CREATE TABLE `testip` ( `id` int(10) unsigned NOT NULL auto_increment, `theip` varchar(100) NOT NULL default '', PRIMARY KEY (`id`), UNIQUE KEY `theip` (`theip`) ) TYPE=MyISAM AUTO_INCREMENT=7 ; SELECT theip, SUBSTRING_INDEX( theip, ".", 1

[PHP-DB] SSL with MySQL 4.0

2004-06-24 Thread Edgar Hassler
Does PHP support SSL connections to MySQL? If no, does anyone have an idea how to make an SSL conncetion to MySQL using PHP? Thanks, Edgar Hassler -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Date help needed

2004-06-24 Thread Chris Payne
Hi there, Just got back and tried it and it works perfectly, thank you so much for your help, you've got me out of a bind here ;-) Chris You could loop through the weeks and put those 3 specifically in: $days = array(); for($i = 0; $i < 365; $i +=7) { $days[] = strtotime('next Monday', strtoti

Re: [PHP-DB] Date help needed

2004-06-24 Thread Justin Patrin
You could loop through the weeks and put those 3 specifically in: $days = array(); for($i = 0; $i < 365; $i +=7) { $days[] = strtotime('next Monday', strtotime('+ '.$i.' days')); $days[] = strtotime('next Friday', strtotime('+ '.$i.' days')); $days[] = strtotime('next Sunday', strtotime('+ '.

[PHP-DB] Date help needed

2004-06-24 Thread Chris Payne
Hi there everyone, I have a problem, I currently have some code which populates a dropdown box - this code gives me every day for the next x amount of days (EG: a years worth of days), however what I really need to be able to do, is to find a way to display this data in the dropdown box but ONL

Re: [PHP-DB] help with consecutive numbers in db

2004-06-24 Thread Matt Matijevich
[snip] The IP's (for example 192.168.1.1) are all in a single field. [/snip] If it is a possiblity, I would store each IP in its own row, with a column in that row being some kind of flag, like: is_issued as a logical column. Can you change you db layout or is it set in stone? -- PHP Database M

[PHP-DB] help with consecutive numbers in db

2004-06-24 Thread redhat
I have a small script that I mangled together to enable me to input user IP addresses into a MySQL db. The IP's (for example 192.168.1.1) are all in a single field. The IP field is set to VARCHAR(100) Unique but it is not the primary key. I have found that my IPs are not consecutive and I would

RE: [PHP-DB] regular expression help

2004-06-24 Thread Matt Matijevich
[snip] That does not work either... I can not make the statement fail!!! I have tried $password = "123456"; and $password = "abcdef"; I have change the if statement to what is below and past in all letters and it still works? if (preg_match ('/\d/', $password)) { die ("You must have a numb

RE: [PHP-DB] regular expression help

2004-06-24 Thread Matt Matijevich
you only want to check to see if there is at least one digit? If that is true, this should work: if(preg_match('/\d/',$password)) { echo 'password ok'; } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] regular expression help

2004-06-24 Thread Matthias Steinböck
i see... so the pattern you need is $atLeast = 2; $pattern = '#\d{1}#'; if(preg_match_all($pattern, $password, $a) > $atLeast) { echo 'password ok; contains at least '.$atLeast.' digits.'; } hth greez ma Larry Sandwick wrote: I would like to make sure that there is at least 1 number in the

Re: [PHP-DB] regular expression help

2004-06-24 Thread Matthias Steinböck
ok... this still does not do what you want, because it does not consider that only digits should be between the letters... here is the correct solution: // dies $password = 'alfgoesswimming'; // dies too $password = 'a2lf4g2o4e7s9s3w9i0m5m7i0n3g'; // survives $password = 'a2$5l5f4g2o4e7s9s3w9i0

RE: [PHP-DB] regular expression help

2004-06-24 Thread Matthias Steinböck
hi! is this correct: you want to check if there are two letters in the password wich do not surround a digit? if so this is what you need: // dies $password = 'alfgoesswimming'; // dies too $password = 'a2lf4g2o4e7s9s3w9i0m5m7i0n3g'; // survives $password = 'a2l5f4g2o4e7s9s3w9i0m5m7i0n3g'; $foun

RE: [PHP-DB] regular expression help

2004-06-24 Thread Larry Sandwick
That does not work either... I can not make the statement fail!!! I have tried $password = "123456"; and $password = "abcdef"; I have change the if statement to what is below and past in all letters and it still works? if (preg_match ('/\d/', $password)) { die ("You must have a number betw

Re: [PHP-DB] value error in PHP form

2004-06-24 Thread Jason Wong
On Thursday 24 June 2004 18:07, Rinku wrote: > I had written the code : > if(isset($_POST['Variable1'])&&isset($_POST['Variable2'])) > { > Print "Rinku"; > } > Here, even if variables are not set then even I am getting Output as > "Rinku". Some form elements, eg , are always "isset()" even wh

RE: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Hutchins, Richard
OK then, couple more questions. 1. What is user.php? Is it the code you posted under "second page"? 2. Also, on your first page, are you sure that your $check_user_res = mysql_query($check_user_query) or die(mysql_error().": $check_user_query"); query is firing properly? If it isn't then your

Re: [PHP-DB] value error in PHP form

2004-06-24 Thread Zachary Krakov
Hi Rinku, The statement syntax that I believe will work you is the following: If (($VARIABLE1 !== '') && ($VARIABLE2 !== '')) { print "Rinku"; } Let me know if this works. Hope this helps. Best, -Zak From: Rinku <[EMAIL PROTECTED]> Date: Thu, 24 Jun 2004 03:07:12 -0700 (PDT) To: Zachary Krak

Re: [PHP-DB] regular expression help

2004-06-24 Thread Matt Matijevich
try this $password = 'abcdef'; if (preg_match ('/\w\d\w/', $password)) { die ("You must have a number between 2 letters in your password ... 0-9"); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread H. J. Wils
this is the output: Array ( ) very empty ;) From: "Matt Matijevich" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> Subject: Re: [PHP-DB] [PHP]: session problem Date: Thu, 24 Jun 2004 10:50:01 -0500 MIME-Version: 1.0 Received: from stimpy.alliancetechnologies.net ([63.86.10.3]) by

Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Daniel Clark
What are you setting $_SESSION['sid'] to? > i do ($_SESSION['sid']), but the variables remain empty... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] regular expression help

2004-06-24 Thread Larry Sandwick
The *if* statement should fail with the password abcdef being qualified but it never fails ? If I understand the expression right, it should have at 1 number in it between 2 letters ? $password = abcdef; if (preg_match ("/[A-z]+[0-9]+[A-z]+/", $password)) { die ("You must have a n

RE: [PHP-DB] [PHP]: session problem

2004-06-24 Thread H. J. Wils
indeed... From: "Hutchins, Richard" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] [PHP]: session problem Date: Thu, 24 Jun 2004 11:52:38 -0400 MIME-Version: 1.0 Received: from pb1.pair.com ([216.92.131.4]) by mc6-f23.hotmail.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 24 Jun

RE: [PHP-DB] Re: Posting Data to MySQL

2004-06-24 Thread Galbreath, Mark A
agreed - poor design. -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 11:21 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: Posting Data to MySQL "Mark A Galbreath" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Doesn't mat

Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Jason Wong
On Thursday 24 June 2004 23:43, H. J. Wils wrote: [snip] >$_SESSION['logged_in'] = true; >$_SESSION['sid'] = $sid; >$_SESSION['user'] = $uid; > >$dt = date("Y-m-d H:i:s"); You should always session_wr

RE: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Hutchins, Richard
So, on your second page you NEVER see the "Welcome..." get echoed out? It always forwards you to the user.php page? > -Original Message- > From: H. J. Wils [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 24, 2004 11:44 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP-DB]

Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Matt Matijevich
do you get any output on the second page if you do this? '; print_r($_SESSION); print ''; if ( isset($_SESSION['logged_in'])){ echo "Welcome..."; }else{ header("location: user.php?action=9"); } ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.

Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Daniel Clark
Are you getting any errors displayed? The php.ini file has to have a directory specified for the session temp variables. > I want to use sessions to check wether a user is logged in or not. > Therefore,I use session_start and session_register. When I registere the > values on the same page, they

Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread H. J. Wils
this is the code, but this code works on my hosting provider but not on my own server. I think i have to change settings in php.ini but dont know which... first page: session_start(); include "connect.php"; include "functions.php"; $user= $_GET["email"]; $ww = $_GET["ww"]

[PHP-DB] Re: Subject: Update data problem

2004-06-24 Thread Neil Smith [MVP, Digital media]
Is there any obvious reason why you're not doing this in one query $query = "UPDATE media SET A='$A', B='$B', C='$C', G=E*'$C'"; Or have I missed something here ? Cheers - Neil At 10:07 24/06/2004 +, you wrote: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_=_Next

Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Matt Matijevich
[snip] i do ($_SESSION['sid']), but the variables remain empty... [/snip] If you are using the array forget about session_register. http://www.php.net/session_register Could you post a little code? That will make this easier to solve. -- PHP Database Mailing List (http://www.php.net/) To unsu

Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread H. J. Wils
i do ($_SESSION['sid']), but the variables remain empty... From: "Matt Matijevich" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> Subject: Re: [PHP-DB] [PHP]: session problem Date: Thu, 24 Jun 2004 09:58:15 -0500 MIME-Version: 1.0 Received: from pb1.pair.com ([216.92.131.4]) by mc

Re: [PHP-DB] Re: Posting Data to MySQL

2004-06-24 Thread Torsten Roehr
"Mark A Galbreath" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Doesn't matter how many fields are on a form; they are returned as an array > of strings in the request object. Just iterate through the array and update > the corresponding database fields. Mark, what I was trying t

Re: [PHP-DB] [PHP]: session problem

2004-06-24 Thread Matt Matijevich
[snip] But when I ask the value of a registered session variable on another page, it is empty?!?! Does anyone know how this comes? i am using session_start() at every page.. [/snip] try the $_SESSION array for starage of session variables. -- PHP Database Mailing List (http://www.php.net/) To

[PHP-DB] [PHP]: session problem

2004-06-24 Thread H. J. Wils
I want to use sessions to check wether a user is logged in or not. Therefore,I use session_start and session_register. When I registere the values on the same page, they all seem to work. But when I ask the value of a registered session variable on another page, it is empty?!?! Does anyone know

RE: [PHP-DB] Re: Posting Data to MySQL

2004-06-24 Thread Galbreath, Mark A
Doesn't matter how many fields are on a form; they are returned as an array of strings in the request object. Just iterate through the array and update the corresponding database fields. Mark -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 1

[PHP-DB] Re: Posting Data to MySQL

2004-06-24 Thread Torsten Roehr
"Tom Chubb" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am trying to design a form that posts the data to a DB, but being new to > PHP/MySQL, it takes me ages to hand write the code and I'm sure there must > be an easier way to do it? > My form has 100 fields using 20 rows and 5

[PHP-DB] Posting Data to MySQL

2004-06-24 Thread Tom Chubb
I am trying to design a form that posts the data to a DB, but being new to PHP/MySQL, it takes me ages to hand write the code and I'm sure there must be an easier way to do it? My form has 100 fields using 20 rows and 5 columns and it's taking me ages to write the code for it. Can anyone advise how

Re: [PHP-DB] value error in PHP form

2004-06-24 Thread Rinku
Hi Zak, Thanks for your suggestion. It really worked. Now pls answer for the query described below : I had written the code : if(isset($_POST['Variable1'])&&isset($_POST['Variable2'])) { Print "Rinku"; } Here, even if variables are not set then even I am getting Output as "Rinku". Could y