Re: [PHP] INSERT INTO using foreach

2004-07-23 Thread Jason Davidson
It may be a matter of opinion, but i beleive this is a poor method of
doing what your doing.  I would get my values thru $_REQUEST and use
addslashes to escape what needs to be escaped, and i would write my
SQL query with full column listing and string values in quotes.  eg..
INSERT INTO table (column, column, column) VALUES ('$string',
'$string') etc

the loop method sort of obfusicates the code, making it hard to read,
especially if you didnt write the form.

My 2 cents, for whatever its worth.  Good luck however :)

Jason

On Fri, 23 Jul 2004 15:46:27 -0500, Alex Hogan
<[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I have a form with several values to insert.
> I thought that I remember a thread that discussed using a loop to insert
> $_POSTed values.
> I am trying;
> 
> foreach($_POST as $key => $value){
>   if($key == 'Submit'){
>   exit;
>  }
>  else{
>   $sql = "INSERT INTO registration ('$key')
>   VALUES ('$value')";
>   $result = mssql_query($sql);
>  }
> }
> 
> I keep getting an invalid object 'registration' error.  However
> registration is the name of the table.  I'm guessing it's someplace else
> in the statement that I'm messing up on.
> 
> alex hogan
> 
> *
> The contents of this e-mail and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom it is addressed. The
> views stated herein do not necessarily represent the view of the company. If you are
> not the intended recipient of this e-mail you may not copy, forward, disclose, or
> otherwise use it or any part of it in any form whatsoever. If you have received this
> e-mail in error please e-mail the sender.
> *
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Array help

2004-07-23 Thread Jason Davidson
You can either hard code the associations, with something like a
swtich statement, or i suppose loop thru one array, adding a key value
pair of the numbers => background images.  Or, you could create a
table called Backgrounds, give them an id which you store in the
existing field of your db, and use a table join to query the
background name out .  Does this help any?

Jason

On Fri, 23 Jul 2004 16:02:06 -0500, Robb Kerr
<[EMAIL PROTECTED]> wrote:
> I've got a field in my database that contains a single numerical character
> ("1" or "2" or "3", etc.). I need to load a different background image in
> one cell of a table depending upon what the number the field contains.
> What's the easy syntax for associating entries in the field ("1" or "2" or
> "3", etc.) with image filenames ("bkgrnd-default.gif" or
> "bkgrnd-positive.gif" or "bkgrnd-negative.gif", etc.)
> 
> Thanx,
> Robb
> 
> --
> Robb Kerr
> Digital IGUANA
> Helping Digital Artists Achieve their Dreams
> 
> http://www.digitaliguana.com
> http://www.cancerreallysucks.org
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error parsing php.ini

2004-07-23 Thread Jason Davidson
Im beat, unless there is any more information that could possibly clue
me in, im lost.  A one time error on a section of file that is
commented out i dont understand.  im sorry :(
.. some hardware glich or something maybe??? ... i dunno. haha

Jason

On Fri, 23 Jul 2004 14:10:09 -0700, Pablo Gosse <[EMAIL PROTECTED]> wrote:
> 
> Jason Davidson wrote:
> > Oh, it was a one time error, strange, youve never had this error
> > before, and this definately is the php.ini file your using, ie, there
> > isnt another somewhere thats getting used?  
> 
> 
> Quothe the terminal:
> 
> [EMAIL PROTECTED] html]$ find / -type f -name "php.ini" 2>/dev/null
> /u0/local/apache2/conf/php/php.ini
> 
> Yup.  That's the only php.ini.  This is the only time it happened, and
> it was the only error in the log.
> 
> Any other ideas?
> 
> Cheers and TIA.
> 
> Pablo
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested If...Else...

2004-07-24 Thread Jason Davidson
print out all the values of the vars your comparing often youll
find one of them is not what your expecting

Jason

On Sat, 24 Jul 2004 11:05:06 -0500, Robb Kerr
<[EMAIL PROTECTED]> wrote:
> What's wrong with this syntax. I just can't see my mistake.
> 
> if ($vBkgrndImage == "AnswerPage") {
>   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
>   } else {
> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
>   }
> }
> 
> Thanx
> --
> Robb Kerr
> Digital IGUANA
> Helping Digital Artists Achieve their Dreams
> 
> http://www.digitaliguana.com
> http://www.cancerreallysucks.org
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: If...Or...Else

2004-07-24 Thread Jason Davidson
OR is also bitwise is it not?

Jason

On Sat, 24 Jul 2004 21:23:13 +0400, Stan F <[EMAIL PROTECTED]> wrote:
> Operations OR and || have different execution priorities. I'd prefer "||" as
> it's "more important" so not so many parentheses needed to ensure the order
> of interpretation is exactly what u need.
> 
> 
> 
> - Original Message -
> From: "Tularis" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, July 24, 2004 6:57 PM
> Subject: [PHP] Re: If...Or...Else
> 
> > if(a OR b) {
> >   do something
> > } else {
> >   do something else
> > }
> >
> > or
> >
> > if(a || b) {
> >   do something
> > } else {
> >   do something else
> > }
> >
> > is enough :)
> >
> > Robb Kerr wrote:
> > > From time to time I need an If statement that includes an Or
> condition...
> > >
> > >  > >   if ((condition1 == TRUE) OR (condition2 == TRUE)) {
> > > do something;
> > >   } esle {
> > > do something else;
> > >   }
> > > ?>
> > >
> > > What's the correct syntax for the If line?
> > >
> > > Thanx
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unexpected T_ENCAPSED...

2004-07-24 Thread Jason Davidson
whats in UserId var.. any spaces or nonword chars.. if so, quote it.

Jason

On Sat, 24 Jul 2004 19:49:04 +0100, Harlequin
<[EMAIL PROTECTED]> wrote:
> I've been working on a query to retrieve a user's data based on their UserID
> that is stored in a variable "$_SESSION['logname']" which underneath I
> convert using: $UserID = $_SESSION['logname'];
> 
> But when I execute a SELECT query:
> 
> $CaptureDetails = "SELECT * FROM RegisteredMembers
>WHERE UserID = $UserID";
> 
> I get:
> 
> Unknown column 'Admin' in 'where clause'
> 
> I've tried everything I can think of. any suggestions...?
> 
> --
> -
>  Michael Mason
>  Arras People
>  www.arraspeople.co.uk
> -
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unexpected T_ENCAPSED...

2004-07-24 Thread Jason Davidson
Sorry, let me clearify.. unless UserId is an integer, quote it !!

jason

On Sat, 24 Jul 2004 12:03:54 -0700, Jason Davidson
<[EMAIL PROTECTED]> wrote:
> whats in UserId var.. any spaces or nonword chars.. if so, quote it.
> 
> Jason
> 
> 
> 
> On Sat, 24 Jul 2004 19:49:04 +0100, Harlequin
> <[EMAIL PROTECTED]> wrote:
> > I've been working on a query to retrieve a user's data based on their UserID
> > that is stored in a variable "$_SESSION['logname']" which underneath I
> > convert using: $UserID = $_SESSION['logname'];
> >
> > But when I execute a SELECT query:
> >
> > $CaptureDetails = "SELECT * FROM RegisteredMembers
> >WHERE UserID = $UserID";
> >
> > I get:
> >
> > Unknown column 'Admin' in 'where clause'
> >
> > I've tried everything I can think of. any suggestions...?
> >
> > --
> > -
> >  Michael Mason
> >  Arras People
> >  www.arraspeople.co.uk
> > -
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: If...Or...Else

2004-07-24 Thread Jason Davidson
ah right.. :)
Jason

On Sat, 24 Jul 2004 19:50:17 +, Curt Zirzow
<[EMAIL PROTECTED]> wrote:
> * Thus wrote Jason Davidson:
> > OR is also bitwise is it not?
> 
> No, | is bitwise
> 
> Curt
> --
> First, let me assure you that this is not one of those shady pyramid schemes
> you've been hearing about.  No, sir.  Our model is the trapezoid!
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Embedding JavaScript into a PHP generated web page

2004-07-25 Thread Jason Davidson
Hey, keep trying, you can use php to generate JS to send to the
browser, its especially usefull for form validation as you said.  Make
sure your JS is correct, and within script tags.  Start with simple
JS, like, alert("i worked");  then start adding one piece at a time
and constantly checking to see if its still working.

JAson

On Sun, 25 Jul 2004 08:05:07 -0700, Robert Frame
<[EMAIL PROTECTED]> wrote:
> Hi There,
> 
> I have a web page with a form that is generated by PHP, and part of my
> design utilizes JavaScript to provide some error checking within the objects
> in the form.  I have written the javascript in an html document, but I am
> having trouble blending the two together.
> 
> I have tried sending the javascript within an echo statement, as well as
> using straight HTML/JavaScript code, but nothing seems to work.
> 
> Can anyone offer some help or direct me to a solution?
> 
> Thanks,
> Rob
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP - mySQL query question

2004-07-25 Thread Jason Davidson
single quote 'y'

Jason

On Sun, 25 Jul 2004 11:05:23 -0400, Karl-Heinz Schulz
<[EMAIL PROTECTED]> wrote:
> I have a simple question (not for me).
> 
> Why does this query does not work?
> 
> $links_query = mysql_query("select id, inserted, title, information,
> international from links WHERE international = y; order by inserted desc
> LIMIT 0 , 30");
> 
> The information for the "international" fields are:
> 
> Field: international
> Type: char(1)
> Null: No
> Default:n
> 
> The error is -> Warning: mysql_fetch_row(): supplied argument is not a valid
> MySQL result resource in
> 
> TIA
> 
> Tracking #: BC19379918870340BDA57FD3E349C2D0B4B484BC
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Refer a class

2004-07-25 Thread Jason Davidson
If there is no error, check the values of all the vars and array
ellements in your logic for the first method.  Make sure its actually
getting to the point where it instantiates the new object.

Jason

On Sun, 25 Jul 2004 19:36:44 +0200, Michael Ochs <[EMAIL PROTECTED]> wrote:
> Hi,
> I try to load some 'modules' into my class. These modules are other classes.
> I want to refer the main class to this new module but that doesn't work. At
> the moment it looks like this:
> 
> Mainclass:
> 
> function loadModule($name) {
> if(class_exists($name)) { //Class found
> if(!$this->module[$name]) {
> $this->module[$name] = new $name(&$this);
> }
> return true;
> } else {
> return false;
> }
> }
> 
> The mainfunktion of the module:
> 
> function module_artikelvote(&$parent) {
> $this->main = &$parent;
> return true;
> }
> 
> I can use $this->main->VARIABLE but the values are old. If I call a function
> with $this->main->func_name(); it doesn't work, but there also isn't an
> error message!
> 
> What's wrong with these functions?
> 
> Thanks for help, Michael
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Usng Session Vaiable in WHERE Statement

2004-07-26 Thread Jason Davidson
hey, just take the single quotes around the word logname out and you
should be ok.

Jason

On Mon, 26 Jul 2004 12:58:28 +0100, Harlequin
<[EMAIL PROTECTED]> wrote:
> Could someone please help me with my syntax here...?
> 
> $MembersDataQry = "SELECT * FROM MembersData
> WHERE UserID='$_SESSION['logname']'";
> 
> I get an error on line 2 but can't seem to figure out what I've missed.
> 
> The variable echoes fine so I know there's a string in there.
> 
> --
> -
>  Michael Mason
>  Arras People
>  www.arraspeople.co.uk
> -
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Refer a class

2004-07-26 Thread Jason Davidson
What version of PHP is this, in php 5, all classes are passed by
reference by default i beleive.

Jason

On Sun, 25 Jul 2004 20:00:18 +0200, Michael Ochs <[EMAIL PROTECTED]> wrote:
> I can call $myclass->module['mymodule']->variable; so I think the class is
> instantiate correctly. But the reference doesn't seem to work, cause the
> variable I get ist always the same:
> 
> $myclass->nickname = "xyz";
> $class2 = $myclass->loadModule("mysecondclass");
> $myclass->nickname = "abc";
> 
> Now, when I call $this->main->nickname in $class2, wich actually should call
> $myclass, it returns "xyz" instead of "abc"!
> 
> Any idea?
> 
> Thanks, Michael
> 
> "Jason Davidson" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
> 
> 
> > If there is no error, check the values of all the vars and array
> > ellements in your logic for the first method.  Make sure its actually
> > getting to the point where it instantiates the new object.
> >
> > Jason
> >
> > On Sun, 25 Jul 2004 19:36:44 +0200, Michael Ochs <[EMAIL PROTECTED]>
> wrote:
> > > Hi,
> > > I try to load some 'modules' into my class. These modules are other
> classes.
> > > I want to refer the main class to this new module but that doesn't work.
> At
> > > the moment it looks like this:
> > >
> > > Mainclass:
> > >
> > > function loadModule($name) {
> > > if(class_exists($name)) { //Class found
> > > if(!$this->module[$name]) {
> > > $this->module[$name] = new $name(&$this);
> > > }
> > > return true;
> > > } else {
> > > return false;
> > > }
> > > }
> > >
> > > The mainfunktion of the module:
> > >
> > > function module_artikelvote(&$parent) {
> > > $this->main = &$parent;
> > > return true;
> > > }
> > >
> > > I can use $this->main->VARIABLE but the values are old. If I call a
> function
> > > with $this->main->func_name(); it doesn't work, but there also isn't an
> > > error message!
> > >
> > > What's wrong with these functions?
> > >
> > > Thanks for help, Michael
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Retrieve The Last Record in a Table

2004-07-26 Thread Jason Davidson
as mentioned already, use a column in the table to order the query and
then use LIMIT to only to return one record. Best columns to use would
be an auto_increment or a datetime field type.

Jason 

On Mon, 26 Jul 2004 18:27:25 +0100, Harlequin
<[EMAIL PROTECTED]> wrote:
> 
> 
> I would like to retrieve the last entry in a login table and present that to
> a user so they can verify the date we have when they last logged in.
> 
> Is this possible...?
> 
> --
> -
> Michael Mason
> Arras People
> www.arraspeople.co.uk
> -
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is there a brian I can pick?

2004-07-26 Thread Jason Davidson
Hey, an alternative to your switch statement, is to have an
associative array with the full State names in it like this ...
$states = array('MI'=>'Michigan'); and so forth.
then just uses it in your html..  $states['$state'];

Jason

On Mon, 26 Jul 2004 15:28:11 -0400, Tom Ray [Lists]
<[EMAIL PROTECTED]> wrote:
> Hey all-
> 
> I've run into a small bump in some code I'm writing for a membership
> database. The first thing that needs to be done is an index of all
> states in the US with members. The fun part is that the state
> information is stored as the abbreviation in the database (ie MI, WI)
> and the HTML page needs to display the full name of the State. I want to
> display the information in a four column table that kicks out as many
> rows as needed. Now in order to get the full name of the state, I'm
> running the state result through a switch statement. Actaully, it's
> working rather well expect for this little issue:
> 
> Row 8: South Dakota Tennessee Texas Virgina
> Row 9: West Virgina Wisconsin Texas Virgina
> 
> I need to kill that extra Texas and Virgina.here's how I'm doing this:
> 
> 
>  $query=mysql_query("SELECT DISTINCT state FROM members WHERE
> country='US' ORDER BY state ASC");
> while($q=mysql_fetch_array($query)) {
> $q1=mysql_fetch_array($query);
> $q2=mysql_fetch_array($query);
> $q3=mysql_fetch_array($query);
> $q4=mysql_fetch_array($query);
> 
> (4 Switch statements here one for q1, q2, q3, q4)
> ?>
> 
>  ?>
> 
>  }
> ?>
> 
> Any thoughts, let me know if more information is needed.
> 
> TIA.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Retrieve The Last Record in a Table

2004-07-27 Thread Jason Davidson
You could LIMIT 2, using the order on a column, the first record would
be last, the second would be second last.  Kinda dirty way to do it,
however, off hand, cant think of an alternative, ill post it if i do
think of one though.

Jason

On Tue, 27 Jul 2004 09:59:21 +0100, Harlequin
<[EMAIL PROTECTED]> wrote:
> Thanks for that Jason
> 
> Any suggestions on how I would retrieve the next to last entry...? The last
> time prior to this session that the user logged in...?
> 
> --
> -
>  Michael Mason
>  Arras People
>  www.arraspeople.co.uk
> -
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> 
> 
> > as mentioned already, use a column in the table to order the query and
> > then use LIMIT to only to return one record. Best columns to use would
> > be an auto_increment or a datetime field type.
> >
> > Jason
> >
> > On Mon, 26 Jul 2004 18:27:25 +0100, Harlequin
> > <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > I would like to retrieve the last entry in a login table and present
> that to
> > > a user so they can verify the date we have when they last logged in.
> > >
> > > Is this possible...?
> > >
> > > --
> > > -
> > > Michael Mason
> > > Arras People
> > > www.arraspeople.co.uk
> > > -
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php & paypal

2004-07-27 Thread Jason Davidson
Might be easier to use session vars to track whatever it is your tracking.

Jason

On Tue, 27 Jul 2004 11:11:31 -0400, Mike R <[EMAIL PROTECTED]> wrote:
> 
> Does anyone know if it is possible to pass a variable in the URL to the
> return page when using paypal?
> 
> Meaning, when someone is done a transaction in paypal and they return the
> merchant's site, can a variable be passed all of the way through back to the
> merchant's site?
> 
> :)
> 
> -Mike
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sessions Timeout

2004-07-27 Thread Jason Davidson
I would put a timelimit on the session, create a session var called
time, or loginTime or something, and compare it to time() with php,
give a leyway of an hour or something. This is a standard securty
measure to prevent people from leaving the pc with a session running
all day, and someone else sitting down and ordering the world to his
home.
So if the session is an hour old, destroy it. 

Jason

On Tue, 27 Jul 2004 22:17:08 +0100, Enda Nagle - Lists
<[EMAIL PROTECTED]> wrote:
> Hi Guys,
> 
> I have a problem with a site where I¹m using sessions.
> 
> Basically, I have it so that someone enters the site and their session
> (shopping cart ref) is created on entry (unless it already exists) and all
> variables are stored in the session.
> 
> Problem is that when someone goes so far in the ordering process, and then
> (for whatever reason) leaves the site, and comes back hours, seconds or
> whatever later, and goes again to place an order, the details are different
> (time), and the session stays the same so the order entry is entered twice
> in the database.
> 
> I have gotten around this by checking for the existence of the database
> entry for that person and session, and if the entry exists, then I just
> update the details, but I¹m wondering if there might be a better way of
> doing this?
> 
> I had looked at the idea of sessions expiring and found the following in my
> php.ini file, and see that the session lifetime is set to 24mins, but am
> wondering if there is any given reason why I should change this (or not!).
> 
> session.cookie_lifetime = 0
> session.gc_maxlifetime = 1440
> 
> Thanks for the help,
> 
> Enda
> --
> 
> - + - + - + - + - + - + - + - + - + - + - + - + -
> 
> Enda Nagle
> +353 86 168 0774
> [EMAIL PROTECTED]
> www.category9.com
> 
> - + - + - + - + - + - + - + - + - + - + - + - + -
> 
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Array assistance

2004-07-27 Thread Jason Davidson
I would simply build the array more specifically, so that it doesnt
include things you dont want.
Jason

On Tue, 27 Jul 2004 16:20:02 -0500, Alex Hogan
<[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I have a page where I'm collecting answers from a series of questions.
> The questions are entered into the array one at a time so I can keep
> track of paging.
> $arans  =   array($_POST);
> $_SESSION['arans'][$pageid] = $arans;
> 
> Then I want to check the sum of the array for scoring purposes. However
> I have to get to the key that has the values for the scores.
> 
> for($i = 1; $i <= 10; $i++){
> print_r($_SESSION['arans'][$i]);
> print"";
> }
> 
> Give me this...
> 
> Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) )
> Array ( [0] => Array ( [mc] => 10 [Submit] => Submit ) )
> Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) )
> Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) )
> Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) )
> Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) )
> Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) )
> Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) )
> Array ( [0] => Array ( [mc] => 10 [Submit] => Submit ) )
> Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) )
> 
> Ten separate arrays with an array at 0 that has the data I'm after.
> This is where I'm getting stuck.  How can I get to the keys that are
> either 'mc' or 'truefalse' and sum them?
> 
> Thanks,
> 
> alex hogan
> 
> *
> The contents of this e-mail and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom it is addressed. The
> views stated herein do not necessarily represent the view of the company. If you are
> not the intended recipient of this e-mail you may not copy, forward, disclose, or
> otherwise use it or any part of it in any form whatsoever. If you have received this
> e-mail in error please e-mail the sender.
> *
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] html text area and mysql text fields

2004-07-27 Thread Jason Davidson
i keep the string intact as well, for that exact reason, when you want
to edit dynamically, i dont want all sorts of html tags in my
textarea.  So, the solution i found works, is to use the php funtion
nl2br(). use that when displaying the info in html., that way you dont
actually change the original text.

JAson

On Tue, 27 Jul 2004 22:50:44 +0100, Enda Nagle - Lists
<[EMAIL PROTECTED]> wrote:
> I usually leave the string intact in the database because if you need to
> show it in an admin area or something, you don¹t need to convert it back
> again before populating the text area.
> 
> Suppose it just comes down to personal preference... Or is there a specific
> benefit to doing it this way?
> 
> Regards
> 
> Enda
> --
> 
> - + - + - + - + - + - + - + - + - + - + - + - + -
> 
> Enda Nagle
> +353 86 168 0774
> [EMAIL PROTECTED]
> www.category9.com
> 
> - + - + - + - + - + - + - + - + - + - + - + - + -
> 
> 
> 
> 
> On 27/07/2004 22:55, "Matthew Sims" <[EMAIL PROTECTED]> wrote:
> 
> >> > Hi,
> >> >
> >> > If I have a html textarea for inputting text into a database text field
> >> > how can I keep the formatting of the entered text?
> >> >
> >> > i.e. on the html textarea if the user enters carriage returns i.e. a new
> >> > paragraph I want that to go into the database then when I retrieve it and
> >> > display it on a normal html page I want to keep those carriage returns!
> >> >
> >> > Thanks
> >> >
> >> > Matt
> >
> > Before injecting textarea data into a DB use this:
> >
> > $_POST["textarea"] = str_replace("\n","",$_POST["textarea"]);
> >
> > When retrieving data from the DB for a textarea use this before displaying:
> >
> > $_POST["textarea"] = str_replace("","\n",$_POST["textarea"]);
> 
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] eliminate keyword

2004-07-27 Thread Jason Davidson
if you mean remove the new line characters, then a str_replace('\n',
'', $textbody); should be sufficient.  If thats not what you mean,
please clarify.

Jason

On Tue, 27 Jul 2004 18:29:42 -0500, Raúl Castro <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I have a form with a textarea field, I'm trying to eliminate the  keywords 
> that users write on it, what can I do using php? for instance: the original phrase 
> would be: "Hello  world!"
> after using a function php must be: "Hello world!".
> 
> Thanks
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Showing all users who are logged in

2004-07-27 Thread Jason Davidson
If you have a users table, you could add a field to it that contains
the last login datetime.  and query that table for datetimes that are
less then your session timeout (if one exists).  Of coarse, you would
have to update that table when a user logs in.

Jason

On Tue, 27 Jul 2004 19:55:49 -0400, Jason Giangrande
<[EMAIL PROTECTED]> wrote:
> Anyone have any suggestions as to the best way to keep track of all
> users who are logged in at a given time?  I thought of writing them to a
> temp text file and them deleting the names from the file when a user
> logged out, but I think there has to be a better way.  Anyone have any
> suggestions?
> 
> --
> Jason Giangrande <[EMAIL PROTECTED]>
> http://www.giangrande.org
> http://www.dogsiview.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Adding +7 more days on date() value problem

2004-07-27 Thread Jason Davidson
Definately check out strtotime() function, way easier than adding up
the seconds of a timestamp, or breaking apart a getdate array.

Jason

On Wed, 28 Jul 2004 11:30:42 +0800, Louie Miranda <[EMAIL PROTECTED]> wrote:
> I can't figure how could i add +7 more days on the DD (Day) value. My
> problem is, when the day is close on the end of the month like
> 
> 07/29/2004
> 
> when i add +7 on 29 = 36, its obvious we dont have 36 on the calendar.
> And im creating a program below, to explode it and maybe just add +.
> But i think its useless if im just going to do + on the DD (Day)
> value.
> 
> Hmm :?
> 
> ##
>  $curdate = date("Y-m-d");
> $plus7 = explode("-", $curdate);
> 
> print ("
> cut:
> " .$plus7[0]. "
> " .$plus7[1]. "
> " .$plus7[2]. "
> 
> 
> Current Date: $curdate
> +7 Dats Date: $plus7
> 
> ");
> ?>
> ##
> 
> --
> Louie Miranda
> http://www.axishift.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Newbie image manipulation question

2004-07-28 Thread Jason Davidson
Hey, you can do what your looking for with phps gd comiled in.  You
may need to add jpg, gif libs if you dont already have them.  Check GD
on the php site, there are plenty of examples that cover exactly what
your looking for i think.

Jason

On Wed, 28 Jul 2004 08:05:52 -0700, Brian Dunning
<[EMAIL PROTECTED]> wrote:
> I'm just about to dive into image uploading & resizing for the first
> time. Do I need Imagemagick for this, or are PHP's Image tags adequate?
> All I want to do is let the user upload a graphic, and have PHP
> automatically scale it to a couple of desired sizes, and name them,
> pretty basic stuff.
> 
> I don't suppose there is an example or tutorial of this process
> anywhere, geared toward B1FF the n00b? Obviously this has been done a
> thousand times before...
> 
> Thanks for any clueing-in,
> 
> - Brian
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Session Expiration Timeout

2004-07-28 Thread Jason Davidson
I beleive there is some session timeout setting in php.ini   .. search
for session or expire or timeout in that file.

Jason

On Wed, 28 Jul 2004 20:18:21 +0200, Jordi Canals <[EMAIL PROTECTED]> wrote:
> Hi all,
> 
> I'm dealing with sessions in a project. Here people are editing some
> documents on-line, so it can take long, long time to complete a document.
> 
> The problem is that when it takes so long to edit a page and hitting the
> submit button in a form, the session has expired and the user looses all
> the work done.
> 
> I've been looking for about changing somewhere the session exiration
> time, but only found about the session cookie expiration.
> 
> Also, all examples I've found to not get the session expired talk about
> creating some sort of javascript wich reloads something on a frame,
> iframe, etc.
> 
> I've not found any information about session expiration timeout looking
> at the manual and searching google for many hours ...
> 
> So I came here to ask about:
> 
> - Wich is the default timeout for a session? And, is some way to know
> the expiration time for a session?
> 
> - Is anyway to change the session expiration timeout? I mean a PHP
> parameter or function. Javascript workarounds i've found are not valid
> for me.
> 
> BTW. Making this search I've found two interesting resources for
> managing data base driven sessions:
> 
> An interesting tutorial:
> http://www.devarticles.com/c/a/MySQL/Developing-Custom-PHP-Sessions
> 
> A nice class:
> http://codewalkers.com/seecode/463.html
> 
> Best regards,
> Jordi Canals
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] list($bar['CompanyCode'], $CompanyDB) = mysql_fetch_row($sth) fails.

2004-07-28 Thread Jason Davidson
check the manual for list.  It mentions using only numerical array
indices for list.  There is a warning on it even i beleive.

Jason

On Wed, 28 Jul 2004 20:47:37 -0700, Daevid Vincent <[EMAIL PROTECTED]> wrote:
> Linux. PHP5.
> 
> Why does this fail when using an array element, but using a variable will
> work? Why should PHP care what the variable is I'm trying to store into?
> 
> list($bar['CompanyCode'], $CompanyDB) = mysql_fetch_row($sth);
> 
> But this works:
> 
> list($foo, $CompanyDB) = SQL_ROW($sth);
> 
> And of course I'd have the extra...
> $foo = $bar['CompanyCode'];
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Variable functions within an object

2004-07-29 Thread Jason Davidson
http://ca3.php.net/manual/en/function.call-user-func.php   ?

Jason

On Thu, 29 Jul 2004 17:11:50 -0500, Julio Sergio Santana
<[EMAIL PROTECTED]> wrote:
> I need to record the names of functions, and then use them later.
> Recently I found the following example within the on-line documentation:
>  function foo() {
> echo "In foo()\n";
> }
> 
> $func = 'foo';
> $func();// This calls foo()
> 
> ?>
> 
> then I supposed that it was easy to extend this concept to objects and
> wrote the following case:
> 
>  
> function foo() {
> echo "In foo()\n";
> }
> 
> class a {
>var $fname;
>function a() {
>  $this->fname = 'foo'; // the name of the function
>}
> 
>function execute() { // method to execute the named function
>  $this->fname();
>  // I also tried here
>  // {$this->fname}();
>  // ${this->fname}();
>  // "$this->fname"();
>  // but none of these worked
>}
> }
> 
> $w = new a;
> $w->execute();
> 
> ?>
> 
> And this was the error I got:
> 
> X-Powered-By: PHP/4.1.2
> Content-type: text/html
> 
> 
> Fatal error:  Call to undefined function:  fname() in - on
> line 14
> 
> I know that this can be solved easily with an intermediate variable:
> 
> $temp = $this->fname;
> $temp();
> 
> but I wonder if there is a more direct method.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP5 exception handling

2004-07-30 Thread Jason Davidson
You can check out how exceptions are handled in Java or C++ as well,
they all sorta work the same, you may find more complete docs for
them.

Jason

On 30 Jul 2004 14:58:59 -, Matthew Weier O'Phinney
<[EMAIL PROTECTED]> wrote:
> I've done some reading on the ZE2 exception handling, but I'm not quite
> sure I understand how it works. I'm familiar with the following in perl:
> 
> eval {
> do some stuff...
> }
> if ($@) {
> report an exception...
> }
> 
> Which looks a lot like the following in PHP5:
> try {
> do some stuff...
> }
> catch () {
> }
> 
> The problem I'm running into: what do I pass as arguments to catch()?
> The articles on ZE2 use something like: catch (Exception $e) {}, or
> something like catch(MyException $e) (where MyException is a class they
> defined in their examples). Is the 'Exception' class a base
> class/handler with PHP5? Do I need to create my own exception handler
> classes? Do I even need to catch objects of a specific type, or can I
> simply do:
> catch ($error) {
> do something with $error
> }
> 
> Thanks in advance.
> 
> --
> Matthew Weier O'Phinney   | WEBSITES:
> Webmaster and IT Specialist   | http://www.garden.org
> National Gardening Association| http://www.kidsgardening.com
> 802-863-5251 x156 | http://nationalgardenmonth.org
> mailto:[EMAIL PROTECTED] | http://vermontbotanical.org
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jason Davidson
is it possbile $this->year isnt what you expect? 
Jason

Jon Bertsch <[EMAIL PROTECTED]> wrote: 
> 
> 
> Hi all,
> 
> I have found a problem using the str_replace() function in PHP5. Over this 
> past weekend we switched our production server to php5.0.0 running on 
> apache 1.3.31 on SUSE9.1. Our development environment is identical. I have 
> an application that runs a series of str_replace calls to drop in some 
> document title and link information into an html string before sending it 
> to the browser.
> 
> Code example:
> $html_string[0] = " href=\"read_docs.php?file=@@FISCAL_YEAR@@/@@month@@/393_@@TYPE@@.pdf&type=pdf&action=read\">GEP
> 
> & HIP Balances (GLC393) ";
> 
> $html_output_1 .= $html_string[0];
> 
> $output = str_replace("@@FISCAL_YEAR@@", $this_year, $html_output_1 );
> 
> (I call it three times to do the replacements in the string).
> 
> This basically produces a list of documents with links to there location 
> from a database call.
> 
> On our development box this little application runs fine. In production 
> where our server is getting around 1 million hits a day (but the processor 
> is rarely above 1% usage) this function completely fails. The page just 
> doesn't get shown. If I comment out the calls to str_replace the html goes 
> over perfectly with the @@TOKEN@@ instead of the necessary information. If 
> I change the str_replace to say YEAR or FISCAL etc it makes no difference.
> 
> I dropped the production server to php 4.3.8 and the str_replace() function 
> works exactly as expected and there are no problems loading the page. Bump 
> back to php5.0.0 and it coughs again.
> 
> Has anyone else seen anything like this or does anyone have an explanation? 
> I can recode the series of str_replace calls but now I'm somewhat worried 
> that other solutions will also fail.
> 
> It seems to me like there's maybe a load tolerance bug in php5 when running 
> str_replace() since I can't see this on our development box nor in 4.3.8.
> 
> The only difference in the functions between php4 and 5 is the addition of 
> the count option, could that be the issue?
> 
> Any help or comments would be greatly appreciated.
> 
> Thanks
> 
> Jon Bertsch
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: POST superglobal is empty

2004-08-04 Thread Jason Davidson
How about 
print_r($_REQUEST);

Dan Phiffer <[EMAIL PROTECTED]> wrote: 
> 
> Craig Donnelly wrote:
> > Show the code you are using...
> 
> I'm having the same problem. Here is a test script that prints Array() 
> regardless of what you enter and submit with the form:
> 
> -- test.php --
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jason Davidson
Yup, i understand not in php 5, there was some large OO changes in php
5, which is why i asked about $this->year. Ive been using php 5 for the
last year, and havent had a problem with str_replace, and have used it a
fair amount for loading email templates.   
So when you look at the source, the @@FISCAL_YERAR@@ is still in the
html lines?  str_replace did not do anything at all?

Jason

Jon Bertsch <[EMAIL PROTECTED]> wrote: 
> 
> 
> 
> Jason wrote:
>  >is it possbile $this->year isnt what you expect?
> 
> If I hard code the value it makes no difference and it works fine 
> in  php4.3.x and in dev just not on php5  with some load on the server. It 
> was tested on the same server before moving to live production and it 
> worked then as well.
> 
> Jon Bertsch
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jason Davidson
My mistake on $this_year.  


Jon Bertsch <[EMAIL PROTECTED]> wrote: 
> 
> 
> Jason,
> 
> This code is not using any OO the variable is $this_year  not $this->year.
> 
> Running it under php5 on my dev box the string replace function works and 
> replaces the text as expected.
> 
> Jon Bertsch
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] opposite of array_unique()?

2004-08-04 Thread Jason Davidson
you could loop thru the array, and using a nested loop, test each value
against all other values.. and keep ones that match in a new array.

But as mentioned, SQL would be easier.


Jason

Curt Zirzow <[EMAIL PROTECTED]> wrote: 
> 
> * Thus wrote Adam Williams:
> > for example if I have an array:
> > 
> > array( [0] => 'dog', [1] => 'cat', [2] => 'rabbit', [3] => 'cat')
> > 
> > how do I make it just have array ( [0] => 'cat' )?  i want to drop the 
> > non-duplicates and trim the array to only have one of the duplicates?
> 
> If you're pulling this data from a sql table, then you're better
> off having the database server do this work for you.
> 
> 
> Curt
> -- 
> First, let me assure you that this is not one of those shady pyramid schemes
> you've been hearing about.  No, sir.  Our model is the trapezoid!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Need Some Direction

2004-08-05 Thread Jason Davidson
I created a simpleAuth script that handles authentication, then sets up
a session, there is a method that i called requireAuth();  i call this
method on any page i want restricted to the members, it checks the for
the valid sessoin, and also checks the time of login, and calls my
destoy method if user is over an hour logged in.   if not valid
session, or over the time limit, headers to some page and gives
appropriate error message to user.

Jason

"Aaron Todd" <[EMAIL PROTECTED]> wrote: 
> 
> Hello,
> 
> I am trying to build up a members only site, but I need some direction.  So
> far I have written a page that will let a user register for access.  That
> script emails me their info so I can validate it, sends them a "thankyou"
> email and then sends the data to a temporary MySQL database table.  In the
> email that I get I created two links.  One will send the user an acceptance
> email and put their info in a final database table.  The other will send the
> user a Deny email and will delete their info from the temporary database
> table.
> 
> I have also created a login script that will ask for a username and password
> and verify it with the database.  If its all correct then it will redirect
> you to a restricted page.
> 
> The direction I need is how do I go about restricting access to the members
> only pages?  I have been reading up on sessions, which I think will be a
> cool addition to this site, but I still havent found much on restrictin
> access without a username and password.  Currently my login and registration
> pages are located in the root of the domain.  The all the members only pages
> are in a directory called /members/.
> 
> Can anyone give me some direction on how I should go about all this.
> 
> Thanks,
> 
> Aaron
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How pass form variable to window.open()

2004-08-05 Thread Jason Davidson
Unless student is set somewhere else that wont work.. you need the form
to submit before the text field 'student' sets a var named student. 
One way to do such, without all the window formating is to just submit
the form to the page you want. and target=_new in the form tag.  

other than that, you must use javascript to grab the data from the
textfield, then use window.open() ..create  a javascript method called
openwin or something that gets called OnClick on your button.

function openWin() {
   student = document.Form.Student.value;
   win = open('yourpage.html?student=' + student, 'Title',
'width=45,height=34');
win.focus();
}

"Jay Blanchard" <[EMAIL PROTECTED]> wrote: 
> 
> [snip]
> Anyone can tell if, inside php script, I can pass form variable to the
> javascript window.open() call?
> 
> That is,
> 
> in the form, for example, i have 
> 
> and  
> It seems to me not working.
> [/snip]
> 
> You have to echo or print the sJavaScript statement with PHP, 
> 
> print(" onClick=\"window.open('url?student=$student', )
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] $HTTP_REFERER

2004-08-05 Thread Jason Davidson
Its possible norton firewall OR your browser is altering the headers. 
how are you redirecting, norton may not allow for some kind of
redirects either.  Try turning norton off, and visiting the page :)  

Jason

"Shaun" <[EMAIL PROTECTED]> wrote: 
> 
> Hi,
> 
> I seem to have problems redirecting pages when I view my site using my
> laptop, the only difference is that my laptop has Norton Firewall installed,
> can this interfere with the $HTTP_REFERER variable and if so is there a more
> reliable alternative?
> 
> Thanks for your help
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] is there a more efficient query?

2004-08-06 Thread Jason Davidson
I would use IN, or even BETWEEN if there exists such a function...  
Jay's example is much cleaner and readable.

Jason

"Jay Blanchard" <[EMAIL PROTECTED]> wrote: 
> 
> [snip]
> Tis SQL 
> 
> SELECT value 
> FROM element_values 
> WHERE user = $user_id 
> AND(element=48
> OR element=52
> OR and so on)
> [/snip]
> 
> You can also use IN
> 
> SELECT value
> FROM element_values
> WHERE user = $user_id
> AND element IN ('48', '52',...)
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] is there a more efficient query?

2004-08-06 Thread Jason Davidson
your only getting one row beucase your only pulling one row from the
array.  You need to loop thru the rows to grab them all.  
Jason

Brian Tully <[EMAIL PROTECTED]> wrote: 
> 
> on 8/6/04 12:28 PM, Jay Blanchard at [EMAIL PROTECTED]
> wrote:
> 
> > [snip]
> > Tis SQL 
> > 
> > SELECT value 
> > FROM element_values
> > WHERE user = $user_id
> > AND(element=48
> > OR element=52
> > OR and so on)
> > [/snip]
> > 
> > You can also use IN
> > 
> > SELECT value
> > FROM element_values
> > WHERE user = $user_id
> > AND element IN ('48', '52',...)
> 
> 
> thanks Jay!
> 
> but that only seems to return the first value. how should I be calling the
> results?
> 
> $query2 = "SELECT value FROM element_values WHERE "
> . "(element=48 OR element=49 OR element=50 OR element=51 OR
> element=52 OR element=53) "
> . "AND user=$user_id";
> 
> $result2 = mysql_query($query2) or die("could not $query2 " .
> mysql_error());
> list($user_name, $address_street, $address_city, $address_state,
> $address_zip, $phone) = mysql_fetch_array($result2);
> 
> do i need to do a while loop and create an array or something?
> 
> thanks again.
> 
> brian
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: IMPORTANT: Please Verify Your Message

2004-08-06 Thread Jason Davidson
Most of the Verify MEssage emails i get come from tgpnexus.com  .. they
are most certainly not from the spoofed address they claim.  

Jason


Chris <[EMAIL PROTECTED]> wrote: 
> 
> Josh Acecool M wrote:
> 
> >I've requested that you do not contact me again.
> >http://www.acecoolco.com/legal.php
> >
> >  
> >
> 
> You know that email isn't coming from this list right? And you also know 
> that, right now, you're annoying me more than the two of those that I've 
> received have.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] String formatting

2004-08-06 Thread Jason Davidson
you could remove all br tags, \n \r chars from the string.  use 
$string = str_replace(array('\r','\n',''), '', $string);
or something similar

Jason

"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote: 
> 
> Hey all! Glad you are here.
> 
> I have a question that is confusing me a bit. I am trying to output a string
> that is pulled from a database that I don't have control over.
> 
> Everything is great, except that the string needs to be all on one line with
> no line breaks (for Javascript's sake). Is there a function in PHP to make
> sure that output is on one line, regardless of the content of the line?
> 
> Below are some examples of the data.
> Thanks in advance!
> 
> MySQL (text)
> --
> Here is some text, and here is the MySQL field is a line break.
> 
> Here is more text that is still part of the text above.
> --
> 
> 
> Needed output (w/ no whitespace)
> --
> Here is some text, and here is the MySQL field is a line break. Here is more
> text that is still part of the text above.
> --
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] String formatting

2004-08-06 Thread Jason Davidson
you could use css too now that i think of it.. wrap your stirng in some
div tag or somehting and use white-space: nowrap; or something like
that.

Jason
[EMAIL PROTECTED] wrote: 
> 
> Jed R. Brubaker wrote:
> 
> >Hey all! Glad you are here.
> >
> >I have a question that is confusing me a bit. I am trying to output a string
> >that is pulled from a database that I don't have control over.
> >
> >Everything is great, except that the string needs to be all on one line with
> >no line breaks (for Javascript's sake). Is there a function in PHP to make
> >sure that output is on one line, regardless of the content of the line?
> >  
> >
> You could just call str_replace() function of PHP along to replace the 
> '\n' with a ' '. If the database does not belong to you you could pass 
> on that load to the db server by using the mysql replace() function 
> instead ;-)
> 
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] any javascript gurus?

2004-08-08 Thread Jason Davidson
what is it that you need... for it to calculate the fields... 
just get the value of the fields with.. 
document.FORMNAME.FIELDNAME.value
make sure your dealing with integers for doing the math, the value will
be a string initially.. use parseInt or parseDouble or something .. 

Jason

"Aris  Santillan" <[EMAIL PROTECTED]> wrote: 
> 
> i need help on this
> 
> 
> 
> 
> 
> 
> Compute quantity
> 
> 
> 
> 
> 
>   
>  
>    
>   Qty 
>   1
>   Qty 
>   2
>   Final 
>   Qty for (Qty1 & Qty2)
> 
>  
>   ITEM 
> ONE
> 
>   
> 
>   
>   
> 
>  
>   ITEM 
> TWO
>   
>   
>   
>   
> 
>  
> 
>   
> 
> 
>   
> 
> 
> 
> 
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ImageColorTransparent Problem

2004-08-08 Thread Jason Davidson
Does IE even support PNG transparncy properly anyways??? maybe thats the
issue here?

Jason
"Kevin" <[EMAIL PROTECTED]> wrote: 
> 
> Hi,
> 
> I am having PHP Version 4.3.4 with GD 2.0.15 compatible and PNG support
> enabled.
> 
> My problem with the following code is that the image produced be this code
> is not transparent. It has a black background. I have viewed it in IE 6 and
> its not transparent.
> 
> Can someone help me how to make this image transparent?
> 
>  
> // imagecolorallocate ( resource image, int red, int green, int blue)
> // imagettftext ( resource image, float size, float angle, int x, int y, int
> color, string fontfile, string text)
> // imagepng ( resource image [, string filename])
> // imagecreatetruecolor ( int x_size, int y_size)
> // imagecolortransparent ( resource image [, int color])
> 
> header("Content-type: image/png");
> $im = imagecreatetruecolor(400,600); // i have used imagecreatetruecolor in
> place of imagecreate()
> $bg = imagecolorallocate($im, 0, 0, 0);
> imagecolortransparent($im, $bg); // this function makes the color
> transparent specified in $bg.
> 
> $j=0;
> $k = 0;
> $r = 1;
> $g = 100;
> $b = 20;
> 
> for($i=1;$i<=50;$i++)
> {
>  if($r > 255)
>   $r = 1;
>  if($g > 255)
>   $g = 100;
>  if($b > 255)
>   $b = 20;
> 
>  $textcolor = imagecolorallocate($im, $r, $g, $b);
>  $r = $r * 3;
>  $g = $g + 10;
>  $b = $b + 20;
> 
>  imagettftext($im, 10, 0, 0, $j, $textcolor, "fonts/2.ttf", "Row number
> : $i | Color = " . $textcolor);
>  $j=$j+12;
> }
> imagepng($im,"kk.png");
> ?>
> 
> Thanks a lot for reading this far.
> -- 
> Kevin
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Need Some Direction

2004-08-09 Thread Jason Davidson
if you have /var/www/html/ defined as documentroot, as you mentioend
then outside is anything outside the directory html/  so /var/www/php/ 
could hold all your php files, and be outside the docroot.

JAson
"Aaron Todd" <[EMAIL PROTECTED]> wrote: 
> 
> When you say "outside of the webroot" do you mean.  Can you give me an
> example.  The root of my web is in /var/www/html/.  Thats where you are
> taken when you punch in my domain.  Currently I have a directory called
> /test/ which is protected by .htaccess but it is inder the
> webroot.../var/www/html/test/  So far under this config I cant get it to
> work, but I'm not sure if I'm still under the webroot in my config.  Do I
> need to move my test directory to lets say /var/www/ or even /var/?
> 
> Thanks again,
> 
> Aaron
> 
> "Torsten Roehr" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > "Aaron Todd" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > I hate to sound ignorant, but how do I get a file out of a .htaccess
> > > protected directory without logging in again?  You cant use the normal
> > > syntax of http://username:[EMAIL PROTECTED] anymore.  Microsoft "fixed"
> that
> > > "bug".
> > >
> > > Thanks,
> > >
> > > Aaron
> >
> > Hi Aaron,
> >
> > because you are accessing a file via PHP from your *local* file system it
> > doesn't matter if the directory is protected or outside of the webroot.
> PHP
> > has access to the file (if read privilege is set). The protection is just
> to
> > deny public access.
> >
> > Take a look here:
> > http://pear.php.net/manual/en/package.http.http-download.intro.php
> >
> > Hope this helps, Torsten
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Global persistent variables

2004-08-10 Thread Jason Davidson
Not like asp's application("") there isnt.  You can use phps $_SESSION
var, which is similar to asps Session().   I dont think php runs the
same asp, in order for asp's application vars to work, you would think
that asp must be running in some state continuously, and i dont think
php does that.  I should read a little more on that to be sure.   But
on first though, answer is nope.

Jason

Jean-Yves Jourdain <[EMAIL PROTECTED]> wrote: 
> 
> Hi,
> 
> Is there a way to have global persistent variable with PHP? I would like 
> to reproduce the use of the ASP  
> possibility. The variable "name" will be available to every users...
> 
> Thank-you in advance,
> 
> Kind regards.
> 
> Jean-Yves
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Global persistent variables

2004-08-10 Thread Jason Davidson
Im not so sure asp is completely stateless is it.  The application var
will hold a var as long as the server is running, for any visitor.  The
var doesnt need to be set each page load either.. 
eg. Application("counter").. you can add to the counter on any page, by
any visitor, at any time, and it will maintain that var untill your
restart your server.  This suggests some sort of state doesnt ot??

Let me know if im wrong.

Jason

"Jay Blanchard" <[EMAIL PROTECTED]> wrote: 
> 
> [snip]
> s there a way to have global persistent variable with PHP? I would like 
> to reproduce the use of the ASP  
> possibility. The variable "name" will be available to every users...
> [/snip]
> 
> One other thing I should have mentioned...neither ASP or PHP is
> 'persistent', they are both stateless. We introduce pseudo-state through
> the use of sessions and/or cookies.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Global persistent variables

2004-08-10 Thread Jason Davidson
Im reading up a little on it, from the msdn site, "make your ASP pages
stateless if possible, relying on Session or Application variables for
transient state only"  Interesting, but not conculsive. ASP sucks
anyways.. 
Bottom line, PHP is definately stateless, and there is no Application()
equivilent in php.

Cheers
Jason

"Jay Blanchard" <[EMAIL PROTECTED]> wrote: 
> 
> [snip]
> Im not so sure asp is completely stateless is it.  The application var
> will hold a var as long as the server is running, for any visitor.  The
> var doesnt need to be set each page load either.. 
> eg. Application("counter").. you can add to the counter on any page, by
> any visitor, at any time, and it will maintain that var untill your
> restart your server.  This suggests some sort of state doesnt ot??
> [/snip]
> 
> It depends on how you define "state". The ASP book that I have here says
> that it is stateless. The value of a variable may be set and "held" for
> each user, but there is no persistent connection to the variable. This
> action is pretty much like sessions in PHP
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP performance [solution]

2004-08-10 Thread Jason Davidson
woohoo indexes kick a$$.. at the expense of mem though :)

J
"Ed Lazor" <[EMAIL PROTECTED]> wrote: 
> 
> I added more indexes.  The 20 minute report just took 40 seconds *grin*
> 
> Thanks Everyone,
> 
> Ed
> 
> 
> > -Original Message-
> > From: Curt Zirzow [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 10, 2004 3:07 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] PHP performance
> > 
> > * Thus wrote Ed Lazor:
> > > Any recommendations on how to make PHP run faster?
> > 
> > To help figure out which queries are running slow there is the
> > php.ini setting:
> > 
> >   mysql.trace_mode=On
> > 
> > Using this will have the php library analyze your queries and if
> > any of them do table scans php will issue a warning about it, which
> > can be very helpful finding out where you need indexes.
> > 
> > >
> > >
> > >
> > > I have a script pulling a lot of data from MySQL and generating reports
> > and
> > > spitting out data (flush) as it's processing so I can see what's going
> > on.
> > > It was taking around 10 seconds to process each order.  I reduced the
> > total
> > > number of orders being processed.  I expected the script to take less
> > time
> > > because there were fewer orders to process, but I was surprised to
> > discover
> > > that time spent processing each order also reduced almost in half.  I
> > > figured PHP's memory limit per script at 8mb might be the bottleneck, so
> > I
> > > upped it to 128, restarted apache, and reran the script.  Increasing
> > > available memory had no effect.
> > >
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] OO Question for PHP4

2004-08-11 Thread Jason Davidson
Im sure you should be returning a value in your constructor at all?? Ill
check the manual, but i dont think ive ever seen a constructor return
anything, doesnt sound right.. Let me check.

Jason

"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote:
> 
> Hi all. As the subject suggests, I am using PHP4 and am having something
> going on that I don't think should be.
> 
> Presume the following code
> class Foo {
> function Foo () {
> return "Bar";
> }
> }
> $foo = new Foo;
> echo $foo;
> 
> $foo comes out as an object. Does this have to be done in two line like
> this?:
> class Foo {
> function bar () {
> return "Bar";
> }
> }
> $foo = new Foo;
> $bar = $foo->bar;
> 
> Or is there a better design approach I should be reminded of or learn?
> 
> Thanks in advance!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] OO Question for PHP4

2004-08-11 Thread Jason Davidson
Yup, i typo'd .. should have read, Im not sure you should be returning a
value..

Jason


Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote: 
> 
> * Jason Davidson <[EMAIL PROTECTED]>:
> > Im sure you should be returning a value in your constructor at all?? Ill
> > check the manual, but i dont think ive ever seen a constructor return
> > anything, doesnt sound right.. Let me check.
> 
> From my experience, returning a value from a constructor currently does
> nothing, in either PHP4 or PHP5. 
> 
> -- 
> Matthew Weier O'Phinney   | WEBSITES:
> Webmaster and IT Specialist   | http://www.garden.org
> National Gardening Association| http://www.kidsgardening.com
> 802-863-5251 x156 | http://nationalgardenmonth.org
> mailto:[EMAIL PROTECTED] | http://vermontbotanical.org
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Adjust two or more mysql rows ?

2004-08-11 Thread Jason Davidson
Yup, confused me...
what is it for?

J
"Dave Carrera" <[EMAIL PROTECTED]> wrote: 
> 
> Hi List,
> 
> I have a qty posted via a form field, lets say 46.
> 
> In my mysql table I have two rows which I want to reduce their qty fields.
> 
> 1 row has a qty of say 13 and the second has a qty of 50, making 63 in
> total.
> 
> So I would like to say something like if $_POST[qty] is greater than row 1's
> qty then update row[qty] = 0, then minus what was the row qty, 13 , from
> $_POST[qty] to new var say $newqty = $_POST[qty]-$row[qty], this leaves 37.
> 
> Then from the 2nd row take 37 from its qty of 50 leaving 13. End result
> being row 1's qty field = 0 and row 2's qty field = 13.
> 
> I hope this is not as clear as mud and if you need further clarity to be
> able to advise me then I will be happy to correspond.
> 
> I thank you fully in advance for any help, logic pointers or nuggets of
> wisdom.
> 
> Dave Carrera
> 
> 
> -- 
> UK Web Hosting @ http://www.ephgroup.com  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.736 / Virus Database: 490 - Release Date: 09/08/2004
>  
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Adjust two or more mysql rows ?

2004-08-11 Thread Jason Davidson
Multiple queries are going to be in order as mentioend i beleive, also,
as mentioned, you may want to put some relational db design into
practice here, im not sure how big your table is going to be, but its
going to have a lot of same data in it.. how about

table products
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(100) NOT NULL,
datein DATETIME NOT NULL

table stock
product_id INT NOT NULL
raw_stock UNSIGNED INT NOT NULL,
other_stock UNSIGNED INT NOT NULL,

jason

"Dave Carrera" <[EMAIL PROTECTED]> wrote: 
> 
> Sort of...
> 
> Here is a sort of layout of my table data:
> 
> Id | prodname | qty | datein
> 1   toy1332004-08-11 13:41:26
> 2   toy2122004-08-11 14:41:26
> 3   toy1162004-08-11 15:41:26
> 4   toy3222004-08-11 16:41:26
> 
> This is what I mean by rows, maybe wrong terminology...
> 
> So as you can see two rows have a qty > 0 and prodname is the same (toy1)
> 
> It is reducing their qtys where datein is oldest from now() is what I am
> trying to do.
> 
> I am trying something now sort of like this:
> 
> $val = $_POST[qty] // equals 53
> 
> Select from table where prodanme=$_POST[pname] and qty >0 order by datein
> desc
> 
> $row = mysql_fetch_array($sql); // this gives me the oldest row with whers
> satisfied
> 
> Now compare $row[qty] with $val
> 
> If its <= $row[qty] then update "row" with row[qty]-$val; exit;
> 
> Else if $val > $row[qty] then $newval = $val-$row[qty];
> 
> Update the current $row[qty] to 0 then run the sql again as it will get the
> row which has a qty value
> 
> Keep going til $newval = 0 exit.
> 
> Probably wont work as I have  it laid out here but I think the basic logic
> is ok.
> 
> Hers goes :-)
> 
> Dave Carrera
> 
> -- 
> UK Web Hosting @ http://www.ephgroup.com  
> 
> 
> -Original Message-
> From: Jason Davidson [mailto:[EMAIL PROTECTED] 
> Sent: 11 August 2004 19:26
> To: Dave Carrera
> Subject: RE: [PHP] Adjust two or more mysql rows ?
> 
> 
> ok, i understand better, so you have a good idea of what your doing by looks
> of it, i guess your trying to get some opinionis on the best way of doing
> this?
> 
> so, to make your query and logic easier, how about making your row1 column
> type an unsigned int, then it cant go below zero, and you can just minus the
> qty right in the update query, then you can do something like.. UPDATE goods
> SET row1 = (row1-$qty), row2 = ..
> 
> likely will have to use some logic to extrapolate some of your values..does
> this help at all... Jason
> 
> "Dave Carrera" <[EMAIL PROTECTED]> wrote:
> > 
> > I am deving a goods in system that REQUIRES that each delivery of 
> > items be entered into raw stock separately. This is why two rows in 
> > the table have identical details like,
> > 
> > Supplier
> > Product name
> > 
> > But the qtys may be diff.
> > 
> > Ect ect
> > 
> > Now the PREPARATION dept need to internally order the RAW STOCK to 
> > make the final items for sale. SO they order from RAW STOCK items they 
> > want and this is where the RAW stock reductions come in.
> > 
> > To keep it simple, I group the identical items available to the PREP 
> > team showing only the total in raw stock. They enter what they need 
> > and this is where I want to reduce the raw stock until I have reached 
> > the total ordered by the PREP team.
> > 
> > I am having a look at array_walk to see if that can help but ask 
> > yourself or the list if you have any ideas how I can step through each 
> > returned row adjusting the qty level until I reach 0 which the posted 
> > value.
> > 
> > I hope that helps
> > 
> > Dave Carrera
> > 
> > 
> > 
> > --
> > UK Web Hosting @ http://www.ephgroup.com  
> > 
> > 
> > -Original Message-
> > From: Jason Davidson [mailto:[EMAIL PROTECTED]
> > Sent: 11 August 2004 19:00
> > To: Dave Carrera; [EMAIL PROTECTED]
> > Subject: Re: [PHP] Adjust two or more mysql rows ?
> > 
> > 
> > Yup, confused me...
> > what is it for?
> > 
> > J
> > "Dave Carrera" <[EMAIL PROTECTED]> wrote:
> > > 
> > > Hi List,
> > > 
> > > I have a qty posted via a form field, lets say 46.
> > > 
> > > In my mysql table I have two rows which I want to reduce their qty
> > > fields.
> > > 
> > > 1 row has a qty of say 13 and the second has a qty of 50, making 63 
> > > in
> > > total.
> > > 

Re: [PHP] Query Question

2004-08-11 Thread Jason Davidson
whats the error, are there any matching fields for the columns
eventetail.event and event.id?
Jason

"Karl-Heinz Schulz" <[EMAIL PROTECTED]> wrote: 
> 
> Why does this query not work?
> It should only show the eventdetails for the shown event.
> 
> 
> -
> 
>  $event = mysql_query("select id, information from event where id=".$id);  
> ?>
>  
> $eventdetail_query = mysql_query("select titles, informations, file_name
> from eventdetail, event where eventdetail.event = event.id");
> 
> while($eventdetail = mysql_fetch_row($eventdetail_query)){ 
> 
> 
> print(" sans-serif;font-size:12px;\"> href=\"../PDF/$eventdetail[2]\"
> class=\"decisions_links\">".strip_tags(html_decode($eventdetail[0]))." span>");
> print("  sans-serif;font-size:12px;\">".html_decode($eventdetail[1])."");
> 
>  }
> 
>  ?>
> 
> 
> -
> 
> 
> TIA
> 
> Karl-Heinz
> 
> 
> 
> 
> Tracking #: B3BFF38AEF0C854C96E9B501DD35C6C783308CA5
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Techniques for doing story

2004-08-17 Thread Jason Davidson
THats kinda cool.  you see that there is also a page=2 query if you
click to a different page, so i would assume, they store the html in a
database for each page of a story. and then give a story_id to those
records.  so in the table, if there is 4 pages for story 12, then there
are 4 records all with story_id 12.  The path to the images is up to
you, i see that site oyu mentioned creates a directory structure using
the contributor, and date, then the directory images.. of coarse you
would need to know the dir path to your uploaded images 

Jason

rogue <[EMAIL PROTECTED]> wrote: 
> 
> Hi all,
> 
> I want to do something like this:
> 
> http://www.cgnetworks.com/story_custom.php?story_id=2259
> 
> Where we can publish an article, multiple page even and lay it out in a 
> nice design with images etc. How do you think this is done? These 
> stories are dynamically generated it seems since the page is passed in 
> the URL. I am just not sure where to start...
> 
> Thanks,
> Rogue
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Techniques for doing story

2004-08-17 Thread Jason Davidson
Friendly crew today. :)

Jason

John Nichel <[EMAIL PROTECTED]> wrote: 
> 
> rogue wrote:
> > Hi all,
> > 
> > I want to do something like this:
> > 
> > http://www.cgnetworks.com/story_custom.php?story_id=2259
> > 
> > Where we can publish an article, multiple page even and lay it out in a 
> > nice design with images etc. How do you think this is done? These 
> > stories are dynamically generated it seems since the page is passed in 
> > the URL. I am just not sure where to start...
> 
> First : http://vzone.virgin.net/sizzling.jalfrezi/iniframe.htm
> Second : http://us4.php.net/manual/en
> Third : http://dev.mysql.com/doc/mysql/en/index.html
> 
> And before you come to a mailing list
> 
> http://www.google.com
> http://groups.google.com
> http://marc.theaimsgroup.com
> http://www.catb.org/~esr/faqs/smart-questions.html
> RTFM
> STFW
> STFA
> 
> -- 
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Techniques for doing story

2004-08-17 Thread Jason Davidson
hehe, funny crew too :)

"Matthew Sims" <[EMAIL PROTECTED]> wrote: 
> 
> > Yea, But then I took his advice and found this
> > http://www.catb.org/~esr/faqs/smart-questions.html#keepcool so I was
> > not so offended :)
> >
> > I had all the other links, but that one and did not think my question
> > was that "out there" for the list... oh well.
> >
> >
> > On Aug 17, 2004, at 12:31 PM, Jason Davidson wrote:
> >
> >> Friendly crew today. :)
> >>
> >> Jason
> >>
> >> John Nichel <[EMAIL PROTECTED]> wrote:
> >>>
> >>> rogue wrote:
> >>>> Hi all,
> >>>>
> >>>> I want to do something like this:
> >>>>
> >>>> http://www.cgnetworks.com/story_custom.php?story_id=2259
> >>>>
> >>>> Where we can publish an article, multiple page even and lay it out
> >>>> in a
> >>>> nice design with images etc. How do you think this is done? These
> >>>> stories are dynamically generated it seems since the page is passed
> >>>> in
> >>>> the URL. I am just not sure where to start...
> >>>
> >>> First : http://vzone.virgin.net/sizzling.jalfrezi/iniframe.htm
> >>> Second : http://us4.php.net/manual/en
> >>> Third : http://dev.mysql.com/doc/mysql/en/index.html
> >>>
> >>> And before you come to a mailing list
> >>>
> >>> http://www.google.com
> >>> http://groups.google.com
> >>> http://marc.theaimsgroup.com
> >>> http://www.catb.org/~esr/faqs/smart-questions.html
> >>> RTFM
> >>> STFW
> >>> STFA
> >>>
> >>> --
> >>> John C. Nichel
> 
> OMG, John. You broke through to someone. This could be good sign. Now if
> we can just get him to stop top posting he'll be ready for anything. ;)
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] OO Theory Question

2004-08-17 Thread Jason Davidson
put something in your script like

if($_SESSION['authed'] == true)
$user = new User($_SESSION['userId']);


or something similar.

Jason


"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote: 
> 
> Hi all! I could use some perspective on a project that I am currently
> working on.
> 
> I am trying to utilize OO to make my PHP easier, but I keep running into
> problems that revolve around the stateless nature of the web.
> 
> Consider the following: I have a login class that is instantiated at the top
> of every page. It can log you in, check to see if you are logged in, etc.
> This class has an assortment of class variables such as userID, userType,
> etc.
> 
> It would be great if I could make a reference to $login->userType on any
> given page, but I run into errors as the login class gets reinstantiated on
> every page.
> 
> A solution is to set all of these variables into $_SESSION, but the appeal
> of classes is that I might be able to maintain all of my information in a
> related location, and not in the session.
> 
> I am sure that this is a problem that many of you more experienced (than I)
> developers have run into. Is there a solution? And ideas?
> 
> Thanks in advance!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] OO Theory Question

2004-08-17 Thread Jason Davidson
So dont make db call, pass appropriate vars thru session... i like to
pass an array of data into my classes, so that there is no db call
inside the constructor, this saves db calls tremendously at times.  
so you could pass an array into session called, UserData or whatever,
and use that to construct your user class..

if($_SESSION['authed'] == true) {
$user = new User($_SESSION['UserData']);
}

no db calls, if you set up for it.
then in your construcor for User you have something like

list($this->username, $this->firstName, $this-) = $data;

this is why i say, or something similar, i gave you a concept, that i
beleive you can work to your needs.

jaosn

"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote: 
> 
> The real reason for having the login class like this is to eliminate
> database calls. I thought I could have one session variable that said yo
> uwere logged in, but then the database calls would still have to be made on
> each page.
> 
> Thanks for the idea - any others?
> 
> 
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > put something in your script like
> >
> > if($_SESSION['authed'] == true)
> > $user = new User($_SESSION['userId']);
> >
> >
> > or something similar.
> >
> > Jason
> >
> >
> > "Jed R. Brubaker" <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi all! I could use some perspective on a project that I am currently
> > > working on.
> > >
> > > I am trying to utilize OO to make my PHP easier, but I keep running into
> > > problems that revolve around the stateless nature of the web.
> > >
> > > Consider the following: I have a login class that is instantiated at the
> top
> > > of every page. It can log you in, check to see if you are logged in,
> etc.
> > > This class has an assortment of class variables such as userID,
> userType,
> > > etc.
> > >
> > > It would be great if I could make a reference to $login->userType on any
> > > given page, but I run into errors as the login class gets reinstantiated
> on
> > > every page.
> > >
> > > A solution is to set all of these variables into $_SESSION, but the
> appeal
> > > of classes is that I might be able to maintain all of my information in
> a
> > > related location, and not in the session.
> > >
> > > I am sure that this is a problem that many of you more experienced (than
> I)
> > > developers have run into. Is there a solution? And ideas?
> > >
> > > Thanks in advance!
> > >
> > > -- 
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] multi-uploading

2004-08-17 Thread Jason Davidson
post some code please.
Jason

"Brad Ciszewski" <[EMAIL PROTECTED]> wrote: 
> 
> I am having troubles with a script im trying to write. I was wondering
> if anyone could help me. The script needs to upload 2 files to a
> directory, and have a field for a name, which will then figure out the
> URLs of the files put them in the database along with the specified
> name. Please help :o
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] OO Theory Question

2004-08-17 Thread Jason Davidson
i think for the ease of use, 1 db call per page is minimal, especially
sinse we are talking about some small fields here.  THe db is local to
the webserver, so really, whats the problem.  
Jason

"Ed Lazor" <[EMAIL PROTECTED]> wrote: 
> 
> > -Original Message-
> > I don't know - is it?
> 
> I would think so.  It's optimized for speed on small data sets.  Does anyone
> else have an opinion on this?
> 
> -Ed
> 
> 
> 
> 
> 
> 
> 
> > 
> > 
> > "Ed Lazor" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > > -Original Message-
> > > > > The real reason for having the login class like this is to eliminate
> > > > > database calls. I thought I could have one session variable that
> > said
> > yo
> > > > > uwere logged in, but then the database calls would still have to be
> > made
> > > > on
> > > > > each page.
> > >
> > > Playing Devil's Advocate here...
> > >
> > > Why would you want to avoid database calls?  If you're using default
> > > sessions management, all you're doing is trading this for accessing
> > files
> > on
> > > the server.  Isn't the database faster?
> > >
> > > -Ed
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP HTML text editor issues...

2004-08-18 Thread Jason Davidson
Do you have magic quotes turned on in your php ini file?

Jason

Tim Traver <[EMAIL PROTECTED]> wrote: 
> 
> Hi all,
> 
> ok, I've made my own version of a file manager complete with a text editor, 
> and I'm having troubles figuring out some issues.
> 
> I present the text to be edited retrieved from a file in a textarea box for 
> a user to edit, and then POST that to my PHP application, which then saves 
> it to disk.
> 
> I have found it to break when the text file has intentional backslashes in 
> it. For instance, if you are editing a perl script, there are a lot of 
> times where you need lots of backslashes in a row.
> 
> Does the POST data get urlencoded as it is coming in to the program, and 
> then PHP unencodes it to put it in the variable ? It seems that there is 
> some kind of translation.
> 
> I've tried to use addslashes and stripslashes to prevent some of the 
> clobbering of the text, but it doesn't seem to be working. If I don't do 
> anything, it looks like PHP (or HTML) backslashes all quotes...
> 
> I just want to get the EXACT text that is in the textarea to be saved to 
> disk...
> 
> Here is an example of a line that gets clobbered :
> 
>   $value =~ tr/\0//d;
> 
> I read the file in from disk using file_get_contents. Does that do any 
> translation ???
> 
> Any help would be appreciated,
> 
> Tim.
> 
> 
> 
> 
> 
> SimpleNet's Back !
> http://www.simplenet.com
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] oop too slow

2004-08-19 Thread Jason Davidson
When i have many many objects of the same type to build, i do something
like this...

function getEvents($sql = '') {
$events = $this->dbh->query("
SELECT cols, cols, FROM table,table 
WHERE blah blah balh ($sql ? " AND $sql" : ''),'rows_array');  
 

$rv = array();  
foreach($events as $event) {
$rv[] = new CalendarEvent($event);
}

return $rv;
}

my event class takes an array of data and uses phps list function to
load its members.  In this case, i save 100s and 100s of queries ,
using just 1.  Its a massive improvment if it fits your scheme.  To get
one event, i create a method called getEvent($id) that is a wrapper to
getEvents, and only uses the first record.. of coarse, there is only
one record.. but ya.. cheers

Jason

Marcus Bointon <[EMAIL PROTECTED]> wrote: 
> 
> on 19/8/04 9:49, Krzysztof Gorzelak at [EMAIL PROTECTED] wrote:
> 
> > Hi
> > I'm trying my new php5 script, but it takes about 1.2s to generate my page.
> > That is, how my oop model looks like :
> > 
> > [category]
> >   |||
> > [photo]  [desc]   [products]
> > 
> > 
> > [products]
> > |
> > [product]
> > |||
> > [photo] [desc] [keys]
> > 
> > 
> > [keys]
> > |
> > [key]
> > |
> > [values]
> > |
> > [value]
> > 
> >   Each object gets data from mysql by itself. The generation time of 1
> > category [30 products, 10 keys, 5 values ~= 300 mysql queries] takes as I
> > said more than a 1s (on quite fast machine). How can this model be improved?
> > Do I create too many objects ? What are the oop solutions for such problem ?
> 
> This is something that I've wrestled with too. If you make each item you
> deal with a clean, self-sufficient object, with self-storage, data hiding
> etc, it is inevitable that you run into this problem. It is a symptom of a
> fundamental clash between Relational DB and OO points of view. The only
> trick I have found to work around it that is OO-clean is to use factory
> methods or objects that create multiple objects from a single DB query, so
> as well as having a 'get' method that populates an object from a DB, make
> another means of creating an object from local data that has been obtained
> from a larger query that returned sufficient values to populate multiple
> items.
> 
> > I also use an extra table to create many-to-many relation betwean a product
> > and a key. Is this the only way in mysql ?
> > 
> > [product]
> > |
> > [product_id, key_id]
> >   |
> >   [key]
> 
> Yes, that's the correct way to represent a M:M relation in a relational DB.
> The join table is an artefact of a relational model, rather than an OO one,
> so the answer is to hide the existence of this table within the objects at
> either end - so have product and key objects, but not product_key objects.
> Each object should have a method that retrieves instances of all the related
> objects of the other kind. This is really a different manifestation of the
> first problem.
> 
> Ultimately the trick is to create separate factory objects or higher-level
> methods inside the existing objects that can create multiple instances from
> a single database query. Having said that, it's difficult to spot the best
> places to do this. For example, you might normally create multiple product
> objects from an array of database IDs like so:
> 
> foreach($productids as $id)
> $products[] = new product($id);
> 
> You can see that this would cause a query for each instantiation.
> 
> With a product factory class, you might do this instead:
> 
> $products = product_factory::get($productids);
> 
> Which achieves the same result, but using only a single DB query (hidden
> inside the factory class, which does NOT call the product class in the same
> way!). The next problem is keeping your product_factory and product classes
> in sync - I'm sure there must be a nice pattern to deal with that somewhere.
> 
> Marcus
> -- 
> Marcus Bointon
> Synchromedia Limited: Putting you in the picture
> [EMAIL PROTECTED] | http://www.synchromedia.co.uk
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dynamic HTML Creation

2004-08-28 Thread Jason Davidson
its possible to add HTML elements with DOM, im not sure what it has to
do with php though?

Jason

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> Is it possible to use the DOM to add (HTML) elements to a page at the time
> the page is being shown? The HTML and VBScript shown below is a simplified
> version of what I need to do but of course I need to do it in PHP. Since PHP
> is server-side (right?) perhaps it is not possible.
> 
> 
> 
> 
> Dynamic Table Demo
> 
> 
> 
> Sub Window_Onload
> Set NewRow = document.createElement("TR")
> Set NewCell = document.createElement("TD")
> NewCell.innerText = "Cell Text"
> NewRow.appendChild NewCell
> TableBody.appendChild NewRow
> End Sub
> 
> 
> 
> Dynamic Table Demo
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dynamic HTML Creation

2004-08-28 Thread Jason Davidson
I suppose it was too much to ask for some clearification.  I hope
someone else helps you.  Good luck, by they way, the difference between
VBScript and Javascript is monumental when using Gecko based browsers.

Jason

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> Read the original question again; it is quite clear about the relevance to
> PHP.
> 
> 
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > its possible to add HTML elements with DOM, im not sure what it has to
> > do with php though?
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Newbie. Posting to backend MySQL database

2004-08-28 Thread Jason Davidson
If you just need to put it in the database, you dont need a form to do
that.. 
just open a connection to your db, and query it in. 

read about mysql functions in the php manual.. specifically
mysql_connect, mysql_select_db and mysql_query
, i beleive there is a functional example of all you need on the
introduction page for the mysql functions in the manual.

Jason


"M. Sokolewicz" <[EMAIL PROTECTED]> wrote: 
> 
> Aidan wrote:
> > Please help, I'm tearing what remains of my hair out here.
> > I've got a MySQL database where I've defined one of the table fields as an
> > integer.
> > Using PSP I've passed a session variable and can echo it to the screen using
> > .  So the session variable exists and can be
> > echoed
> > I now want to pass this session variable to the database into the field I've
> > defined as an integer
> > 
> > I've set up a form to submit other variables to the backend database and
> > they all work apart from this field.
> > 
> > I'm using a hidden field to pass the variable and I am using
> > 
> >  > value="intval('$clin_id')">
> that line doesn't make any sense to me... what are you doing there? 
> you're freely mixing PHP and HTML without denoting what is what.
> an example that WOULD work would be:
> echo ' value="'.intval($clin_id).'">';
> 
> or maybe
> ?>
>value="">
>  
> So, mixing HTML and PHP without denoting what is what is the first 
> mistake. The second one is the actual function call:
> intval('$clin_id');
> 
> Now, when you put something between SINGLE quotes, it is read LITERALLY, 
> meaning it *will not* substitute variables for their value. eg:
> echo '$clin_id';
> 
> will output:
> $clin_id
> 
> However,
> echo "$clin_id";
> will output the VALUE of $clin_id (eg. 12)
> 
> So, I think that instead of
> intval('$clin_id') you actually meant intval("$clin_id"), or, cleaner, 
> intval($clin_id) (since intval isn't expecting a string anyway, and even 
> if it were, it would change it to one itself. No need to do extra work 
> for nothing.)
> 
> The 3rd point about this all... if you get the value from the database, 
> and it's an integer there, then why are you converting it to an integer 
> AGAIN?? :| just using $clin_id instead of intval($clin_id) is surely 
> faster (seen as no extra functions need to be called).
> 
> > 
> > What I don't understand is that if I can echo the variable what am I missing
> > in formatting a sessio variable to make it passable to the database.  It mus
> > be something basic and I've looked through several books (from where I got
> > the intval function) but obviously in the wrong place.
> > 
> > I would be grateful for any advice.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php does not get variable values in POST method

2004-09-02 Thread Jason Davidson
Its possible you had register globals turned on for your server, and its
not turned on now.  How do you retrieve these vars, try retrieving them
with $_REQUEST['myVarName'] or $_POST['myVarName']

Jason

Leticia Campos <[EMAIL PROTECTED]> wrote: 
> 
> I developed an html/php form  in a Php version 4.0.6, working fine, but when
> a moved the files to another web server with Php 4.3.2 the file
> procesaadmision.php called in the Post method does not get any of the input
> html variables defined in the calling form.
>  
> 
> Thanks for any help
> 
> Leticia Campos
> IT Programming
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sessions Problems

2004-09-03 Thread Jason Davidson
Read up on 'named sessions'

I think that may be your solution

jason

Mark <[EMAIL PROTECTED]> wrote: 
> 
> 
> --- Octavio Herrera <[EMAIL PROTECTED]> wrote:
> 
> > No, I do not store two items with the same key, I just open another
> > session
> > in other page and it just overwrite session data of a previous
> > session
> 
> This is because (I believe) you can't open two cookie-based sessions
> with two browser windows and expect to have two separate sessions.
> 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 
> 
> =
> Mark Weinstock
> [EMAIL PROTECTED]
> ***
> You can't demand something as a "right" unless you are willing to fight to death
> to defend everyone else's right to the same thing.
> ***
> 
> 
>   
> ___
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.
> http://promotions.yahoo.com/goldrush
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Linux "locate" to html script?

2004-09-03 Thread Jason Davidson
I assume you mean locating something on the server, as this would be a
serious breech of security otherwise.  anyways, bickticks will run
shell comand line programs and return the output..
ie

print `locate myFile'`;

jason

"BOOT" <[EMAIL PROTECTED]> wrote: 
> 
> Does anyone have a script that can be used to call linux's locate command
> and display the results in a browser?
> 
> I don't think it would be that hard and will make an effort today...
> 
> 
> Thanks!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Clean variables sent from forms

2004-09-04 Thread Jason Davidson
Make some field unique, so it wont work thats an easy solution,
there other ways..
Jason

"Dre" <[EMAIL PROTECTED]> wrote: 
> 
> Hi,
> 
> I'm trying to perform a database insertion for a new record from data I
> receive from a HTML form
> 
> I send the data to the file containing the insertion script and insert the
> values using the $_POST['variable_name']
> 
> every thing works fine, and the record get inserted correctly
> 
> the problem is when I refresh this page (the one containing the database
> insertion script) a new record with the same data is inserted in the same
> table
> (I'm using an auto increamented id for this table) ..
> 
> I was wondering if there is a way that I can delete all values sent from the
> form after the first insertion successeded
> Thanks in advance
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] converting seconds since unix epoc to date array

2004-09-06 Thread Jason Davidson
How is the date stored, MySQL db??? if so, you can select dates out as
unix timestamps.  Otherwise i would use mktime or strtotime... 

Jason

Jason FB <[EMAIL PROTECTED]> wrote: 
> 
> Can anyone tell me how to convert a date stored in the format 
> "-MM-DD" to an integer of seconds since unix epoc,
> 
> then add $daysToAdd days to this value (I suppose if the integer was 
> a number of seconds it would have to be $daysToAdd*60*60*24 to get 
> the number of seconds to add)
> 
> then convert the new value to a timestamp which I can output using the function
> 
> string date ( string format [, int timestamp])
> 
> I tried doing this with mktime() and couple different ways using 
> strtotime() and also with strftime() but I kept getting -1 as the 
> result for strtotime() indicating the function couldn't interpret the 
> given date.
> 
> I've been through all the date-related functions in the manual I can 
> think of, but I'm stumpped on this one...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] converting seconds since unix epoc to date array

2004-09-06 Thread Jason Davidson
beware of dates before 1969.

Justin French <[EMAIL PROTECTED]> wrote: 
> 
> Jason,
> 
> This seems to work fine for me:
> 
>  $daysToAdd= 5;
> $secondsToAdd = $daysToAdd * 86400;
> $dateIn   = "2004-07-24";
> $dateInStamp  = strtotime($dateIn);
> echo date('m/d/Y h:i:s',$dateInStamp+$secondsToAdd);
> ?>
> 
> ... as does the more condensed version:
> 
> 
> 
> If strtotime() is returning -1, that means that it's having trouble 
> converting your -MM-DD date to a timestamp.  The common pitfall is 
> that you've got the month and day mixed up (-DD-MM), or that you're 
> not using 2 digit numbers on the day and month (and 4 digit on the 
> year).
> 
> If you're having trouble with strtotime(), ech out the date you're 
> trying to convert, to make sure it's what you're expecting.
> 
> 
> It's also worth pointing out that we've made no considerations for 
> timezones, daylight savings, etc.
> 
> UNIX timestamps are all GMT, so if the times you're seeing are not as 
> expected (and the dates you're collecting aren't GMT dates, then you'll 
> need to dig a lot deeper -- it's depends how much accuracy you want.
> 
> Justin French
> 
> On 07/09/2004, at 1:59 PM, Jason FB wrote:
> 
> > Can anyone tell me how to convert a date stored in the format 
> > "-MM-DD" to an integer of seconds since unix epoc,
> >
> > then add $daysToAdd days to this value (I suppose if the integer was a 
> > number of seconds it would have to be $daysToAdd*60*60*24 to get the 
> > number of seconds to add)
> >
> > then convert the new value to a timestamp which I can output using the 
> > function
> >
> > string date ( string format [, int timestamp])
> >
> > I tried doing this with mktime() and couple different ways using 
> > strtotime() and also with strftime() but I kept getting -1 as the 
> > result for strtotime() indicating the function couldn't interpret the 
> > given date.
> >
> > I've been through all the date-related functions in the manual I can 
> > think of, but I'm stumpped on this one...
> 
> ---
> Justin French
> http://indent.com.au
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] class packages

2004-09-08 Thread Jason Davidson
Out of curiosity, how would you prefer it?

the way you mentioend is basically how i do though.

Jason

"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote: 
> 
> As far as I can tell there is not an easy way yet to create packages in 
> PHP5.
> 
> It seems the following is the best option:
> include('classes/help/Search.inc');
> 
> // Inside Search.inc and in the same "package"
> include('OtherClass.inc');
> include('AnotherClass.inc');
> 
> Is there a better way?
> 
> Thanks! 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Remove punctuation

2004-09-09 Thread Jason Davidson
http://ca3.php.net/manual/en/function.str-replace.php

if you have the array of puncuation already, i think that is your
solution.

Jason

"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote: 
> 
> Hi all!
> 
> I am creating a function that will remove punctuation from a string, 
> however, I am wondering if PHP has a function somewhere that will do the 
> same.
> 
> Right now my approach is to cycle through an array of punctuation and remove 
> the items.
> 
> Anything already exist?
> 
> Thanks! 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Remove punctuation

2004-09-09 Thread Jason Davidson
i think str_replace is faster that ereg_replace

Jason

John Nichel <[EMAIL PROTECTED]> wrote: 
> 
> Jed R. Brubaker wrote:
> > Hi all!
> > 
> > I am creating a function that will remove punctuation from a string, 
> > however, I am wondering if PHP has a function somewhere that will do the 
> > same.
> > 
> > Right now my approach is to cycle through an array of punctuation and remove 
> > the items.
> > 
> > Anything already exist?
> > 
> > Thanks! 
> > 
> 
> You don't have to cycle through an array...
> 
> preg_replace ( "/[\.,\";'\:]/", "", $string )
> 
> -- 
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Remove punctuation

2004-09-09 Thread Jason Davidson
ya, no doubt, i was going to repost my message, i should have said, that
manual suggests using str_replace over ereg_replace... without reason..
i just assumed it was speed and resources.. 

eitherway, both would work, try em both. :)
Jason


John Nichel <[EMAIL PROTECTED]> wrote: 
> 
> Jason Davidson wrote:
> > i think str_replace is faster that ereg_replace
> > 
> > Jason
> 
> We tested that theory a while back on here (I don't remember the subject 
> of the emails, so finding it would be kind of hard), and it came out to 
> be almost exactally the same speed.
> 
> -- 
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Assigning one var to multiple vars

2004-09-09 Thread Jason Davidson
$var2 = $var3 = $var5 = "all the same";

Jason

"Matthew Sims" <[EMAIL PROTECTED]> wrote: 
> 
> 
> Just mostly curious but is there a way to assign one variable to multiple
> variables in one single line?
> 
> Rather than do this:
> 
> $var2 = $var1;
> $var3 = $var1;
> 
> Is there a method to perform a:
> 
> ($var2,$var3) = $var1;
> 
> -- 
> --Matthew Sims
> --
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] CSS not picked up

2004-09-11 Thread Jason Davidson
Possibly you dont have those fonts to see them?

Jason

"Jeff Swanberg" <[EMAIL PROTECTED]> wrote: 
> 
> I have the following in my CSS (loaded on the main site page):
> 
> /* FOOTER */
> 
> .footer {
> font-family: Tahoma, "Trebuchet MS";
> font-size: 9px;
> color: #BFBFBF;
> text-decoration: none;
> border: none;
> line-height: 1.25em;
> font-weight: bold;
> }
> 
> .footer a:link {
> font-family: Tahoma, Arial, "Trebuchet MS";
> font-size: 9px;
> color: #BFBFBF;
> text-decoration: none;
> border: none;
> line-height: 1.25em;
> font-weight: bold;
> }
> 
> .footer a:visited {
> font-family: Tahoma, Arial, "Trebuchet MS";
> font-size: 9px;
> color: #BFBFBF;
> text-decoration: none;
> border: none;
> line-height: 1.25em;
> font-weight: bold;
> }
> 
> .footer a:hover {
> font-family: Tahoma, Arial, "Trebuchet MS";
> font-size: 9px;
> color: #BFBFBF;
> text-decoration: none;
> border: none;
> line-height: 1.25em;
> font-weight: bold;
> }
> 
> and the following in my PHP script
> 
> 
> © 2004 Keatley Photography -  href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED] - 206 240-5543
> 
> 
> 
> But, when I change the style.css file and upload it and then refresh the 
> browser, any changes to the font, style, etc to the "footer" class are not 
> picked up.  What should I look for??
> 
> Jeff 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread Jason Davidson
There is nothing wrong with what your doing, i use this sort of thing
for all the big sites i make, i use a page class and use methods to
create the header and footer, so your concept is good.  I would
investigate your html_head() function, to make sure its actually
returning something.  Sinse your 'print'ing it, it must return some
text.
example
function html_head() {
 $html = "
}

then i call it with $page->header();

hope that helps?

Jason

Nick Wilson <[EMAIL PROTECTED]> wrote: 
> 
> Hi all, 
> 
> Say i have a php script like this:
> 
>print(html_head());
>   // do loads of time taking stuff
>   print(html_footer());
> ?>
> 
> How come I dont see the html header (it's just a function that returns a
> string with the html up till ) before the entire script has run?
> 
> This goes against my understanding, why might this be and what might i
> use to get some output before the script has finished executing?
> 
> Much thanks...
> -- 
> Nick W
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread Jason Davidson
yup, you took the words from my mouth...

[EMAIL PROTECTED] wrote: 
> 
> dirk wrote:
> 
> >The first function you need to call using  to see the
> output
> >THe second function is not a real function because it has no return
> >statement. In german you call this "Prozedur". Don't know if it's the
> >same as procedure in english. But you will call this piece  >header(); ?> to see some output.
> >  
> >
> The english word you are looking for is procedure. It is true that in 
> some programming languages 'functions that do not return values' are 
> called procedure but I don't think that practice is wide spread among 
> PHP programmers.
> 
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-13 Thread Jason Davidson
Windows XP Firewall, or any other firewall for that matter must be off.
Jason

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> I have:
> PHP Version 5.0.1
> MySQL 5.0.1
> Apache 2.0.48
> Winows XP Pro SP2
> 
> MySQL is working fine as best as I can see; I have tried the various samples 
> in the MySQL manual and I have executed the myTest sample provided with 
> MySQL. They all work.
> 
> However I can't get mysql_connect to work; when I try:
> 
> $conn = mysql_connect("localhost", "root");
> 
> I get:
> 
> Warning: mysql_connect() [function.mysql-connect.chm]: Can't connect to 
> MySQL server on 'localhost' (10061)
> 
> The host and user should be correct; I have not changed anything such as 
> that after installation. The password should still be blank. However I have 
> tried many, many other combinations but nothing that works.
> 
> Is 10061 an error code? I can't find it in the PHP documentation.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-13 Thread Jason Davidson
Also, a google on the error returns hundreds of results..
http://www.google.ca/search?hl=en&ie=UTF-8&q=Can%27t+connect+to+++MySQL+server+on+%27localhost%27+%2810061%29&btnG=Search&meta=

Jason

"Jason Davidson" <[EMAIL PROTECTED]> wrote: 
> 
> Windows XP Firewall, or any other firewall for that matter must be off.
> Jason
> 
> "Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> > 
> > I have:
> > PHP Version 5.0.1
> > MySQL 5.0.1
> > Apache 2.0.48
> > Winows XP Pro SP2
> > 
> > MySQL is working fine as best as I can see; I have tried the various samples 
> > in the MySQL manual and I have executed the myTest sample provided with 
> > MySQL. They all work.
> > 
> > However I can't get mysql_connect to work; when I try:
> > 
> > $conn = mysql_connect("localhost", "root");
> > 
> > I get:
> > 
> > Warning: mysql_connect() [function.mysql-connect.chm]: Can't connect to 
> > MySQL server on 'localhost' (10061)
> > 
> > The host and user should be correct; I have not changed anything such as 
> > that after installation. The password should still be blank. However I have 
> > tried many, many other combinations but nothing that works.
> > 
> > Is 10061 an error code? I can't find it in the PHP documentation.
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-14 Thread Jason Davidson
The webpage of coarse, is not local, regardless of where its hosted, so
a firewall will come into play when trying to connect.  
You dont have disable it, i should have been specifc i suppose, you must
allow for the mysql port to be open. :)
Whats for others to confirm, try it yourself and see if it works.

Jason

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > Windows XP Firewall, or any other firewall for that matter must be off.
> > Jason
> 
> Can someone else confirm that this is correct?
> 
> For one thing, when I use MySQL directly outside of a web page, it works. 
> The sample C program works.
> 
> For another thing, I doubt very immensely that everyone using mysql_connect 
> does not use a firewall. Even if anyone else does, I will not. It would have 
> been quite unreasonable for the developers of PHP to develop software with 
> that requirement, but I doubt it was.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-14 Thread Jason Davidson
Possible i should have checked your configurations, however, to itterate
my point slightly, here is some documentation, you may find it usefull
regardless of how you connect to your db.


http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html

Jason


"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > Also, a google on the error returns hundreds of results..
> >
> http://www.google.ca/search?hl=en&ie=UTF-8&q=Can%27t+connect+to+++MySQL+server+on+%27localhost%27+%2810061%29&btnG=Search&meta=
> 
> 
> One thing I did find in the results is that at least one person had problems 
> using (I think) phpMyAdmin. It supposedly uses mysql_connect. I am not aware 
> of installing phpMyAdmin in my system, so I will try installing and using 
> it. 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-14 Thread Jason Davidson
ok, well, i just posted a link for you to check out, it gives insight on
how mysql connects on different platforms, this will of use to you i
think, the last few bullets in the page i linked to are of some
importance to your error msg which says, cant connect to localhost, and
not, cant connect through socket...

again, link,,
http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html

Jason

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> The firewall I am using is ZoneAlarm, the free version. I am nearly certain 
> that it does not allow specific ports to be opened, at least not for 
> specific addresses. So if this were a requirement, probably many others 
> would have that specific problem.
> 
> However if nothing else works, I will try to look into this further when I 
> have time. At the moment I must spend time on something else.
> 
> 
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > The webpage of coarse, is not local, regardless of where its hosted, so
> > a firewall will come into play when trying to connect.
> > You dont have disable it, i should have been specifc i suppose, you must
> > allow for the mysql port to be open. :)
> > Whats for others to confirm, try it yourself and see if it works.
> >
> > Jason
> >
> > "Sam Hobbs" <[EMAIL PROTECTED]> wrote:
> >>
> >> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message
> >> news:[EMAIL PROTECTED]
> >> > Windows XP Firewall, or any other firewall for that matter must be off.
> >> > Jason
> >>
> >> Can someone else confirm that this is correct?
> >>
> >> For one thing, when I use MySQL directly outside of a web page, it works.
> >> The sample C program works.
> >>
> >> For another thing, I doubt very immensely that everyone using 
> >> mysql_connect
> >> does not use a firewall. Even if anyone else does, I will not. It would 
> >> have
> >> been quite unreasonable for the developers of PHP to develop software 
> >> with
> >> that requirement, but I doubt it was.
> >>
> >> -- 
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-14 Thread Jason Davidson
Hey, i understand that, :)  however, a firewall may restrict _any_
access to a port, and if you are connected thru TCP/IP, then that port
may be restricted even if 'local'.  It is still a client server
relationship regardless where client and server reside.  

Of coarse, this may not be the issue he is having, but it is an issue i
have dealt with before, as retarded as you all seem to think it is.  

Jason

John Nichel <[EMAIL PROTECTED]> wrote: 
> 
> Jason Davidson wrote:
> > The webpage of coarse, is not local, regardless of where its hosted, so
> > a firewall will come into play when trying to connect.  
> > You dont have disable it, i should have been specifc i suppose, you must
> > allow for the mysql port to be open. :)
> > Whats for others to confirm, try it yourself and see if it works.
> > 
> > Jason
> 
> You understanding of how this works is a bit off Jason.  If you make a 
> call to one of my web sites from your machine via a browser, the _only_ 
> port I need to have open to the outside is 80 (or whatever port I have 
> my web server running on), even if I make 1000 calls to a local db, but 
> this has nothing to do with how the web server talks to MySQL.  What is 
> meant by local here, is that the MySQL db and web server are on the same 
> machine. A firewall comes into play when your web browser requests a 
> page from my web server, but does not come into play when that page has 
> to connect to a local db before sending content to you.  Your remote 
> machine never talks to my local MySQL db.
> 
> -- 
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-14 Thread Jason Davidson
And for more testimonies, sinse i fear im getting absolutely no credit
for having any knowledge of mysql and php.. :P  (i say that in jest of
coarse)
search this in google and see how many people fixed the very problem by
disabling or adjusting the firewall.

http://www.google.ca/search?hl=en&ie=UTF-8&q=mysql+firewall+localhost&btnG=Search&meta=

Cheers, and good luck

Jason

"Jason Davidson" <[EMAIL PROTECTED]> wrote: 
> 
> ok, well, i just posted a link for you to check out, it gives insight on
> how mysql connects on different platforms, this will of use to you i
> think, the last few bullets in the page i linked to are of some
> importance to your error msg which says, cant connect to localhost, and
> not, cant connect through socket...
> 
> again, link,,
> http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html
> 
> Jason
> 
> "Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> > 
> > The firewall I am using is ZoneAlarm, the free version. I am nearly certain 
> > that it does not allow specific ports to be opened, at least not for 
> > specific addresses. So if this were a requirement, probably many others 
> > would have that specific problem.
> > 
> > However if nothing else works, I will try to look into this further when I 
> > have time. At the moment I must spend time on something else.
> > 
> > 
> > "Jason Davidson" <[EMAIL PROTECTED]> wrote in message 
> > news:[EMAIL PROTECTED]
> > > The webpage of coarse, is not local, regardless of where its hosted, so
> > > a firewall will come into play when trying to connect.
> > > You dont have disable it, i should have been specifc i suppose, you must
> > > allow for the mysql port to be open. :)
> > > Whats for others to confirm, try it yourself and see if it works.
> > >
> > > Jason
> > >
> > > "Sam Hobbs" <[EMAIL PROTECTED]> wrote:
> > >>
> > >> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message
> > >> news:[EMAIL PROTECTED]
> > >> > Windows XP Firewall, or any other firewall for that matter must be off.
> > >> > Jason
> > >>
> > >> Can someone else confirm that this is correct?
> > >>
> > >> For one thing, when I use MySQL directly outside of a web page, it works.
> > >> The sample C program works.
> > >>
> > >> For another thing, I doubt very immensely that everyone using 
> > >> mysql_connect
> > >> does not use a firewall. Even if anyone else does, I will not. It would 
> > >> have
> > >> been quite unreasonable for the developers of PHP to develop software 
> > >> with
> > >> that requirement, but I doubt it was.
> > >>
> > >> -- 
> > >> PHP General Mailing List (http://www.php.net/)
> > >> To unsubscribe, visit: http://www.php.net/unsub.php
> > >>
> > >> 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php/MYSQL remove duplicate records

2004-09-14 Thread Jason Davidson
you could select out all the DISTINCT email addresses, and delete the
table, and repopulate it with your selected rows add a constraint to
the table to make email column unique afterwards maybe.

Jason

Dustin Krysak <[EMAIL PROTECTED]> wrote: 
> 
> Hi there - I have an extremely simple table that has a unique Id and an 
> email address. what I am looking for is an example of a PHP script 
> that will poll the MYSQL database and delete the duplicate records 
> leaving only 1 unique (email) record.
> 
> can someone point me to the right place?
> 
> thanks!
> 
> d
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-14 Thread Jason Davidson
There is an issue with sp2 and loopback, you can argue all you like, but
many have had this problem, and many have resolved it. Mysql will not
connect through udp, it will use tcp.  If you supply a hostname in your
connect function, it will use tcpip to connect over a port, if oyu dont
supply a hostname, or i beleive put a '.' in its place, it will attempt
to connect through a named pipe which doesnt use the network.  In the
time you spend writing this email, you could have attemped a suggested
solution.  

A little more acceptance to help would gain a lot more respect from me,
not that you probably care about others respect.

And for further note, for the sake of discussion, as you have mentioned
to me on a certain forum.  A firewall can absolutely interfere with a
connection to mysql even if you are using localhost, if, and only if,
that connection is being done over tcpip, which in unix, is rarely, but
in windows, is not all that rare.  

Jason

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> "John Nichel" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > Jason Davidson wrote:
> >> The webpage of coarse, is not local, regardless of where its hosted, so
> >> a firewall will come into play when trying to connect.  You dont have 
> >> disable it, i should have been specifc i suppose, you must
> >> allow for the mysql port to be open. :)
> >> Whats for others to confirm, try it yourself and see if it works.
> >>
> >> Jason
> >
> > You understanding of how this works is a bit off Jason.  If you make a 
> > call to one of my web sites from your machine via a browser, the _only_ 
> > port I need to have open to the outside is 80 (or whatever port I have my 
> > web server running on), even if I make 1000 calls to a local db, but this 
> > has nothing to do with how the web server talks to MySQL.  What is meant 
> > by local here, is that the MySQL db and web server are on the same 
> > machine. A firewall comes into play when your web browser requests a page 
> > from my web server, but does not come into play when that page has to 
> > connect to a local db before sending content to you.  Your remote machine 
> > never talks to my local MySQL db.
> 
> 
> Thank you. As I said previously, I did think that the firewall would not be 
> relevant.
> 
> I don't know a lot about the TCP/IP stuff but I do know enough to write a 
> couple of simple programs. They are actually UDP programs. An example is my 
> "UDP Send and Receive Using CAsyncSocket" at:
> 
> http://simplesamples.info/MFC/UDPSendReceive.php
> 
> Using it, I can send and receive UDP packets within my system using 
> 127.0.0.1 without any problem from my firewall.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-14 Thread Jason Davidson
ok, your the boss on this, i give up :)  what does experience provide
anyways.. 
the important thing is, i can connect to my mysql database :)

Jason

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> And the relevant portion of that says "external access", which is not 
> applicable here. I do not see anything else on that page that is relevant.
> 
> 
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > ok, well, i just posted a link for you to check out, it gives insight on
> > how mysql connects on different platforms, this will of use to you i
> > think, the last few bullets in the page i linked to are of some
> > importance to your error msg which says, cant connect to localhost, and
> > not, cant connect through socket...
> >
> > again, link,,
> > http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-15 Thread Jason Davidson
Good day, im glad you seem to have resolved your problem, i shall
comment on your comments.

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> I appreciate your attempts to help, but you must understand that when 
> attempts to help just cause time to be wasted, then it might be appropriate 
> to not appreciate the help. 
Its no waste of time to attempt a solution, if it doesnt work, youve
eliminated that solution.  That is one step closer.

>Then when I try to explain that you are not 
> helping, you make comments such as this, trying to blame me. If I am the 
> only person you do this to, then I can live with it. If however you do this 
> to others, then I hope you are told by others that you are trying too hard 
> to help and that you resort to insulting others when you don't help.

Im bashing my head on the wall now

> 
> Perhaps there is some validity to what you are saying, but you are also 
> saying some things that are not valid, which makes it difficult or 
> impossible to determine what is valid. I do try to tell you in reasonably 
> polite and useful ways that much of what you say is not helpful. Obviously I 
> need to just ignore your help instead.
> 
Now that you have figured out, that it is possible its your firewall,
which, many, and i think you claimed before was impossible, what
exactly makes you sure i said anything invalid.


Now that my rant is done, i made it clear, that i i have solved a
problem with your EXACT error msg before.  That makes this not a guess,
but an educated and experienced suggestion.  and yes, all forms of help
on this form are as such. 

Yup, im an a$$hole , i dont like being completely shutdown by people
requesting help, when i take the time to impart some experience... 

J


> 
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > There is an issue with sp2 and loopback, you can argue all you like, but
> > many have had this problem, and many have resolved it. Mysql will not
> > connect through udp, it will use tcp.  If you supply a hostname in your
> > connect function, it will use tcpip to connect over a port, if oyu dont
> > supply a hostname, or i beleive put a '.' in its place, it will attempt
> > to connect through a named pipe which doesnt use the network.  In the
> > time you spend writing this email, you could have attemped a suggested
> > solution.
> >
> > A little more acceptance to help would gain a lot more respect from me,
> > not that you probably care about others respect.
> >
> > And for further note, for the sake of discussion, as you have mentioned
> > to me on a certain forum.  A firewall can absolutely interfere with a
> > connection to mysql even if you are using localhost, if, and only if,
> > that connection is being done over tcpip, which in unix, is rarely, but
> > in windows, is not all that rare.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: mysql_connect does not connect

2004-09-15 Thread Jason Davidson
firewall, who would have thought

Jason Wong <[EMAIL PROTECTED]> wrote: 
> 
> On Thursday 16 September 2004 06:14, Sam Hobbs wrote:
> 
> [quote from another Sam Hobbs post]
> > I am the original poster. The reason I avoid doing things like that is
> > because it is a guess. It should not be necessary; the firewal should not
> > be relevant. Sometimes people suggest things that are not likely to be a
> > solution but are easy to suggest.
> [end quote]
> 
> > Apparently there is a problem with the internet being accessed. I tried to
> > determine the problem but it is not clear. What I did to try to diagnose
> > the problem is that I deleted from ZoneAlarm the configuration for the
> > relevant programs. For those not familiar with ZoneAlarm, I essentially
> > removed from it anything it knew about Apache, MySQL and php. I thne tried
> > the
> > mysql_connect, and ZoneAlarm asked if Apache could access the internet.
> > However it behaved differently, depending on whether I was using an account
> > with administrator privileges. If I was using administrator privileges,
> > Apache tried to connect to address 0.0.0.0. If I was not using
> > administrator privileges, Apache tried to connect to the DNS server
> > address. However there are more details so assuming this is a bug I need to
> > coordinate with someone to determine how to diagnose this.
> >
> > By removing Apache, MySQL and php from ZoneAlarm and then allowing Apache
> > to access the internet when I did the mysql_connect, I am able to connect.
> > I assume that this is not how it should be.
> 
> So now are you fully convinced it's your firewall that's the root of your 
> problem?
> 
> 1) How are you connecting using mysql_connect()? Do you use IP addresses or 
> hostnames?
> 2) What are your exact connection parameters when connecting as an "admin 
> user"?
> 3) What are your exact connection parameters when connecting as an "normal 
> user"?
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Moneyliness is next to Godliness.
>   -- Andries van Dam
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] checking multiple URL parameters

2004-09-15 Thread Jason Davidson
same way, if i understand your questoin... 
if your url looks like this

sometestpage.php?mov=something&year=1999
 - the queries are seperated by the '&' char..

then 

$_REQUEST will have both mov and year elements in it
so just as $_REQUEST['mov'] worked, so would $_REQUEST['year']

Jason


Dustin Krysak <[EMAIL PROTECTED]> wrote: 
> 
> Hi there, I am currently using the following code to display content 
> based on the URL parameters
> 
> if (isset($_REQUEST['mov'])) {
>   $movie = ($_REQUEST['mov'])
>   ?>
> HTML CONTENT
>  }
> 
>else {
>?>
>OTHER HTML CONTENT
>   }
> 
> ?>
> 
> now what I need to do is modify the code so that the script checks 2 
> URL parameters, and has 2 variables defined (from the URL parameter)...
> 
> So I need to also check if $_REQUEST['year'] is set as well as the 
> original (both need to be set to get the first HTML content) AND I also 
> need to set the variable of $year = ($_REQUEST['year']
> 
> direction?
> 
> d
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How I can create....

2004-09-15 Thread Jason Davidson
the reason it doesnt work, is becuase you have muddied the requests for
the client and the server.  PHP is completely server side, so putting a
php function name in onclick, which will execute client side code doesnt
work.  

the solution would be to have you button reload the page, or submit to
another page, that has your function call on it.  make sense?

Jason

"Yusdaniel Rodriguez Espinosa" <[EMAIL PROTECTED]> wrote: 
> 
> Hello to everyone.
> 
> I want to clean a field from my Data Base in MySQL from a button. But I don't
> know how i can create a button in PHP, the funtion of button is TRUNCATE
> TABLE(Table).
> 
> I have a form in HTML but hi don't work because when I press the button he don't
> do anything, but when i press the button submit he work I don't know way!!!
> 
> Here are the Form HTML Code:
> 
> 
> Nick : 
> 
> Email: 
> 
> Password: 
> 
> Nombre: 
> 
> 
> 
>  onClick="" >
> 
> 
> and here are the code in PHP:
> 
> function Limpiar() {
> $servidor = "localhost" ;
> $usuario = "usuario" ;
> $contrasena = "password" ;
> $basededatos = "bd" ;
> $conectar = mysql_connect($servidor, $usuario, $contrasena);
> mysql_select_db($basededatos,$conectar) ; 
> $Limpiar = "Truncate table bd";
> mysql_query($Limpiar);
> }
> 
> how I cant create a button in PHP that he make the same function
> 
> 
> thanks
> 
> Yusdaniel

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strip Everything But Letters and Numbers?

2004-09-15 Thread Jason Davidson
i think with perl regs.. as preg_replace is, you can just use a shortcut
command.. 
\w is any word char,
\d is any digit.. 
im not sure it will improve this solution any, but its something else :P

Jason

Marek Kilimajer <[EMAIL PROTECTED]> wrote: 
> 
> Jeff Oien wrote:
> > Is there an easy way to strip out everything but letters and numbers 
> > from a string? I tried searching the archives and didn't come up with 
> > much. Thanks.
> > Jeff
> > 
> 
> $string = preg_replace('/[^a-z0-9]/i', '', $string);
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: mysql_connect does not connect

2004-09-16 Thread Jason Davidson
woah, full functionality.. it has will still connect, at least, it will
still connect for me.  Where the functionality is missing, im not sure.
 But sinse the error is cant connect to localhost, i would say that it
strying to connect to localhost, and not being allowed.  

That said, im fully open to the idea that this may be the problem, im
just reporting that i have connected to a mysql version greater than
4.1 with mysql_connect.  

Jason

Curt Zirzow <[EMAIL PROTECTED]> wrote: 
> 
> * Thus wrote Sam Hobbs:
> > "Janbro" <[EMAIL PROTECTED]> wrote in message 
> > news:[EMAIL PROTECTED]
> > > Hi I connect to a MySQL 4.1 with the following String:
> > >
> > >
> > > if
> > > ($db_verbin=mysqli_connect("$mysql_host","$mysql_user","$mysql_passw","$DB_n
> > > ame"))
> > >
> > > watch the i in mysqli_connect!
> > >
> > > I think I've read somewhere that you are required to use that for the >4.1
> > > Versions, but you
> > >
> > > better look that up, I might be wrong there.
> > >
> > > Hope this helps
> > >
> > > JanBro
> > 
> > 
> > When I do try mysqli_connect, I get:
> > 
> > Fatal error:  Call to undefined function mysqli_connect()
> > 
> > So obviously I need to do something to enable that. I will look into that 
> > later, but I am still trying to get mysql_connect to work.
> 
> RTFM.
> 
> mysql:
>   This MySQL extension doesn't support full functionality of MySQL
>   versions greater than 4.1.0. For that, use MySQLi.
> 
> mysqli:
>   The mysqli extension is designed to work with the version 4.1.3 or
>   above of MySQL.
> 
> 
> 
> Curt
> -- 
> The above comments may offend you. flame at will.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-16 Thread Jason Davidson
i am in total agreeance of this post.  Sinse the 'flame' war is
primarily between me and everyone else, especially sam hobbes, (not the
first time either), no more contributiuons to this thread from me.  I
hope it gets resolved, and i hope it gets posted as much so others can
search the archive of this thread for solutions.  

If anyone actually wants to discuss, and not argue, over the relevance
of a firewall in this sitiution, please start a new thread.  

Jason


Markus Mayer <[EMAIL PROTECTED]> wrote: 
> 
> On Thursday 16 September 2004 05:06, Sam Hobbs wrote:
> > It is my understanding that the firewall is not supposed to be relevant. I
> 
> It is our experience at my employer that the firewall in XP-SP2, as well as 
> other firewalls that are available, are very relevant.
> 
> > have not seen anything saying it is supposed to be. 
> 
> We also have not seen any documentation about "problems" with such things 
> after installing SP2, but we have problems.  Things that worked before don't 
> work any more, especially client side things.  Our three small Windoze 
> servers have given our Windoze administrator more than enough work recently.
> 
> > If it is true that it 
> > is not supposed to be relevant, then simply saying it is just causes
> > confusion. If you had said that the firewall is not supposed to be
> > relevant, but try disabling it anyway, then I would say that I am totally
> > able to think like that too. It is reasonable to try things like that to
> > diagnose a bug.
> 
> flame blocked by firewall.
> 
> > If you can find something in the MySQL documentation saying that the
> > firewall needs to be disabled eventhough the server and client are the same
> > system, then that would sure help. I am not asking you to; I am saying that
> > that is what would help.
> 
> SP2 is so new that its effects are still being evaluated by a lot of people.  
> At the moment, I think the best place to get information about its effects is 
> forums like this one.  Formal documentation will be updated in time as more 
> experience is gained.  The info I got from our Windows admin is that with 
> SP2, the MS SQL server on one machine was apparenty unaffected, but the MySQL 
> on another was.  Dropping the MS Firewall in SP2 allowed connections again.
> 
> Client side, SP2 has caused nothing but problems for us to the point where we 
> as administrators are now saying to our users "it was working before you 
> installed SP2, and after you installed SP2 it stopped working, so it's your 
> problem".  IE is especially problematic, and when someone calls up and says 
> they have a problem with IE and have installed SP2, our response is that we 
> no longer support IE and tell the users to install Mozilla, and if they still 
> have problems when they try Mozilla, they can call us back.  We haven't heard 
> from any of them again, and our help desk girls have always been able to 
> quickly sort out the problems users have when they first try Mozilla.
> 
> I looked back in this thread and saw that you used Zone Alarm as a firewall.  
> You need to allow MySQL connections to localhost, and that regardless of 
> which firewall you use.  If you filter such connections out, PHP scripts will 
> not be able to connect to your MySQL server.  This is because PHP makes a TCP 
> connection to the MySQL server, also when it is running on the same machine 
> as you PHP/Apache (at least this is my understanding).  You can of course 
> continue refuse all external (that is not from localhost) connections to 
> whatever service is running on your machine.  I think something to this 
> effect has already been said in this thread, but at the moment I don't want 
> to search for the post.
> 
> While the flame war in this thread has been amusing to read, it's amusement 
> value for me has more or less run out.  My impression is that you still don't 
> have the thing working, and the only solution left is to configure your 
> firewall to allow connections to your MySQL server from localhost.  If you 
> would do this, and it works, please post to the list to reflect this.  My 
> experience as an administrator tells me with a 99% certainty that this is 
> your problem.
> 
> regards
> Markus
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_connect does not connect

2004-09-17 Thread Jason Davidson
The last paragraph refers to me :) and im quite proud of it now, ive
printed some of your emails out, and i keep them around, they really do
make me smile, not becuase im so much an a$$hole, but becuase, youve
already said, that altering your firewall allowed you to connect. 
Which not so coincidently, i suggested in the beginning.  You call it a
guess, an uneducated blunder maybe,  whatever helps you sleep at night

PS.. takes you half hour to drop your firewall.. sheesh,.. and for note,
and honestly, for your benefit, SP2 _will_ enable a _new_ firewall on
your computer, unless youve configured otherwise, there is a new
security center that will complain if your firewall is not enabled,
have you seen this complaint?

J


"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> "Jason Wong" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> >
> > The firewall is relevant depending on your circumstances. In any case it 
> > would
> > take you all of one minute to disable your firewall to test out this "wild
> > far out suggestion". At the most you would have lost one minute but you 
> > would
> > have either:
> >
> > - gained the satisfaction of saying "I told you the firewall was 
> > irrelevant,
> > now go away and stop wasting my time with your ridiculous suggestions"
> >
> > or
> >
> > - you would have found the cause of your problem
> 
> It definitely takes more than a minute. It takes nearly a minute just to 
> logoff one user and I often have another user, the Administrator account, 
> also logged in. If the Administrator account is not lgged in already, then I 
> must log in to it to shutdown ZoneAlarm. Then the system must shutdown and 
> restart. While that is happening, I must unplug the cable modem to ensure I 
> get nothing from/to the outside, but that can be done in parrallel with 
> system shutdown. However I must stay at the system while this is happening; 
> I prefer to unplug the cable after the system disconnects from the modem. 
> Then I must log in to at least one account and start a few things, such as 
> Apache. Relatively speaking, Apache starts immediatley, so it is not very 
> relevant, but it does take time for my system to start. Then after the test 
> I must restart ZoneAlarm, restart the system and be sure to plug the modem 
> back in while the system starts. The whole operation is likely to take 
> nearly a half hour at least.
> 
> > Contrast that with the number of posts you have made denying that the 
> > firewall
> > could be a problem, and stating adamantly that you will not do 
> > such-and-such
> > a thing because it is 'not supposed' to happen like that.
> 
> The problem is all the people that persist in saying the same thing. I am 
> smart enough to think of the things being suggested. It is the type of thing 
> that is very easy to suggest. I get frustrated by people suggesting things 
> just because they are easy to suggest. Therefore when people make a 
> suggestion that is more likely to be relevant it is difficult for me to 
> determine which ones are worthwhile. And again, I am able to think of things 
> such as eliminating the firewall as a possibility. It is okay for people to 
> suggest that, but unless they can show me something that clearly says it is 
> relevant, then they won't accomplish anything by insisting.
> 
> One problem is that I get answers that are not accurate, so it is difficult 
> to know which ones are accurate.
> 
> The most important thing is that unless people give me a clear explanation 
> of what they are saying, it is useless to insist. I don't mind a suggestion 
> as much as it is the insisting that causes problems. Therefore from my point 
> of view, it is the insistance by others that keep the discussion going (in 
> useless directions).
> 
> There is one person in particular that tries too hard to help and then when 
> I politely say I am getting too much help I get criticized. That is not a 
> productive attitude.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: mysql_connect does not connect

2004-09-17 Thread Jason Davidson
Yes yes, your always relevent, we are not... funny that you have the
problem and we do not though. 

Jason

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> "Jason Wong" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> >
> > I'm not familiar with MySQL under Windows, but I believe that there are
> > different installers available from various sources. So saying "Typical"
> > installation option doesn't really mean much.
> 
> There is only one Windows installer available rom the MySQL web site and it 
> has an option that explicitly says "Typical". Therefore in this context 
> "Typical" is extremely specific and relevant.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Fw: [PHP] mysql_connect does not connect

2004-09-17 Thread Jason Davidson
Cheers on that, this thread has become amusement, that is payment enough

Jason


"John Holmes" <[EMAIL PROTECTED]> wrote: 
> 
> "Sam Hobbs" <[EMAIL PROTECTED]> wrote in message
> > One problem is that I get answers that are not accurate, so it is
> > difficult to know which ones are accurate.
> 
>  You are correct about that. Personally, I not satisfied with the level of
>  support I get from the people paid to monitor this list and help me out 
> when
>  I have a problem, either. Just imagine if the people on this list were
>  volunteers and "just trying to help"... good god, that'd be horrible,
>  wouldn't it?
> 
>  ---John Holmes...
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Fw: [PHP] mysql_connect does not connect

2004-09-17 Thread Jason Davidson
Im not a john, but to add to confusion we could all sign with 'J'

Jason

John Nichel <[EMAIL PROTECTED]> wrote: 
> 
> John Holmes wrote:
> > "Sam Hobbs" <[EMAIL PROTECTED]> wrote in message
> > 
> >> One problem is that I get answers that are not accurate, so it is
> >> difficult to know which ones are accurate.
> > 
> > 
> > You are correct about that. Personally, I not satisfied with the level of
> > support I get from the people paid to monitor this list and help me out 
> > when
> > I have a problem, either. Just imagine if the people on this list were
> > volunteers and "just trying to help"... good god, that'd be horrible,
> > wouldn't it?
> > 
> > ---John Holmes...
> > 
> 
> Damn, it's going to be hard to tell the "John's" apart on this list 
> soon.  ;)
> 
> -- 
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   >