RE: [PHP-DB] Datetime help in an INSERT...

2003-06-06 Thread NIPP, SCOTT V (SBCSI)
I have actually discovered that the $td value is blank.  The reason
appears to be that the page is reloading when a button is pushed, and that
is when the $td value is being lost.  My question now is, how do I keep the
$td value after the page is reloaded?  I would rather keep the value from
the original query than perform another database query to populate this
value yet again.  Thanks yet again for the help.

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 2:14 PM
To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Datetime help in an INSERT...


> > I am stumbling across something that I thought I have done before,
> > and I am not having any luck finding an example of this.  Basically, I
am
> > wanting to timestamp the date and time into new entries in a simple
> database
> > table.  The following section is the actual code for this, and I cannot
> > figure out how to get the date/time stamp to populate into the database.
> > Thanks in advance for the help.  I suspect this is a very simple fix.
> >
> > $denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td,
> NOW())";
> > $denylog_result = mysql_query($denylog, $Prod) or die(mysql_error());
>
> The error I am receiving is:
>
> You have an error in your SQL syntax near ' NOW())' at line 1

Are you sure $td has a value? If it's blank, you'd get an error like that.

---John Holmes...

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



[PHP-DB] Cookie issue

2003-06-06 Thread Marie Osypian
We are having complaints on our site about users not being able to log-in
and we feel it maybe related to the setting of cookie.  Here is the code
used.  Can anyone give me insight.


/* some standard var's or other things like srand */
srand((double)microtime() * 100);
$includes_root  = "$DOCUMENT_ROOT/includes";
$encoded_url= urlencode($REQUEST_URI);

if($_COOKIE["cookie_check"] != "Y")
{
setcookie("cookie_check", "Y", strtotime("+5 years"), "/",
"$HTTP_HOST", 0);
}

if($_COOKIE["current_surfer_id"] == "" AND $_COOKIE["cookie_check"] ==
"Y")
{
$current_surfer_id = rand(0, 16777215);

setcookie("current_surfer_id", $current_surfer_id, strtotime("+5
years"), "/", "$HTTP_HOST", 0);
}



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



Re: [PHP-DB] Datetime help in an INSERT...

2003-06-06 Thread CPT John W. Holmes
> I have actually discovered that the $td value is blank.  The reason
> appears to be that the page is reloading when a button is pushed, and that
> is when the $td value is being lost.  My question now is, how do I keep
the
> $td value after the page is reloaded?  I would rather keep the value from
> the original query than perform another database query to populate this
> value yet again.  Thanks yet again for the help.

Stick it in the session? cookie? URL? What is $td?

---John Holmes...


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



RE: [PHP-DB] address info, forms, maintanance

2003-06-06 Thread chip . wiegand
"John W. Holmes" <[EMAIL PROTECTED]> wrote on 06/04/2003 05:24:22 
PM:

> > Thanks to everyone for the suggestions. Got it fixed. Just added a
> couple
> > lines of code -
> > $sql1 = "select * from endusers where name like '$name'";
> >$result1 = mysql_query($sql1);
> >  $count1 = mysql_num_rows($result1);
> >  if ($count1 == "0" )
> >$sql = "insert into endusers..blah blah blah
> 
> > Now it works fine, no more duplicate entries. 
> 
> But now you're doing two queries for every insert. If you simply made
> your columns unique and let the database handle it, you'd only have to
> do one INSERT. Then check affected_rows() or mysql_error() to see if
> either no rows were affected (no rows inserted) or the error mentions
> duplicate. If either is the case, the row wasn't inserted because of a
> unique constraint. If there is an error but it's not "duplicate" or
> whatever, then it's another error and you should show it. 
> 
> ---John W. Holmes...

Thanks for the tips, I'll work on that. In the meantime, this database is 
pretty
low useage, very specialized information for a small market segment, so 
for now
it will be okay. It'll never have hundreds or thousands of hits per day. 
But I 
will look into making the suggested changes.
Thanks,
Chip

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



Re: [PHP-DB] while - if - problem

2003-06-06 Thread Earl
Hey thanks Mike
that surly made a difference.

Earl
'
- Original Message -
From: "Ford, Mike [LSS]" <[EMAIL PROTECTED]>
To: "'Earl'" <[EMAIL PROTECTED]>; "PHP-DB" <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 6:13 AM
Subject: RE: [PHP-DB] while - if - problem


> > -Original Message-
> > From: Earl [mailto:[EMAIL PROTECTED]
> > Sent: 04 June 2003 22:04
> > To: PHP-DB
> >
> > FYI
> > this was beginning to bug me out... so I decided to try the
> > trim function
> > and walla... it worked.
> >
> > Thanks for ya'll assistance.
>
> I was going to say this even before you added the trim() calls in , but
this
> really does look like an excellent situation for using the switch
construct
> (just look at all those trim() calls and array accesses you save!):
>
>
> while($cols=ifx_fetch_row($eventQuery))
> {
>   switch (trim($cols['out_type']))
>   {
> case '0':
>   $r_away['linetype']='L';
>   $r_home['linetype']='L';
>   break;
>
> case '1':
>   $r_away['linetype']='H';
>   $r_home['linetype']='H';
>   break;
>   }
>
>   switch (trim($cols["s_acro"]))
>   {
> case 'CF':
> case 'PF':
>   $r_away['sport']='1';
>   $r_home['sport']='1';
>   $s_lt='PS';
>   $t_lt='TP';
>   break;
>
> case 'PB':
> case 'CB':
>   $r_away['sport']='2';
>   $r_home['sport']='2';
>   $s_lt='PS';
>   $t_lt='TP';
>   break;
>
> case 'B':
>   $r_away['sport']='3';
>   $r_home['sport']='3';
>   $s_lt='ML';
>   $t_lt='TM';
>   break;
>
> case 'H':
>   $r_away['sport']='4';
>   $r_home['sport']='4';
>   $s_lt='ML';
>   $t_lt='TM';
>   break;
>   }
>
> Cheers!
>
> Mike
>
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-06 Thread NIPP, SCOTT V (SBCSI)
OK.  I guess the next question would be what is the best option for
performance?  This portion of the app currently doesn't have any session
functionality built in.  I would be setting up the session for this sole
purpose.  I haven't worked with cookies yet.  I suppose the URL method might
work, I have just never like it because I think it looks unclean, just
personal preference there.
As to the $td question...  This is a variable that holds the userid
of the "Technical Director" who is the account approver.  This portion of
the app is simply an approval mechanism to an account request system that I
am developing.  The "TD" receives an e-mail with a link back to the approval
page to approve the requested accounts.  This approval then fires off an
e-mail to the SA responsible for user accounts to inform him to create the
newly approved account.
Well, thanks again for the feedback.  Hopefully I can get this going
pretty quick.  We are currently planning on rolling this app out to our user
community on Monday.  This is the last issue I have that I am aware of.

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 9:06 AM
To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Datetime help in an INSERT...


> I have actually discovered that the $td value is blank.  The reason
> appears to be that the page is reloading when a button is pushed, and that
> is when the $td value is being lost.  My question now is, how do I keep
the
> $td value after the page is reloaded?  I would rather keep the value from
> the original query than perform another database query to populate this
> value yet again.  Thanks yet again for the help.

Stick it in the session? cookie? URL? What is $td?

---John Holmes...

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



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-06 Thread NIPP, SCOTT V (SBCSI)
Not sure exactly how I would implement this.  Currently the reload URL
is being provided via the "$PHP_SELF" variable.  I like using this, but
suppose I could change this if truly necessary.  Also, the $td is not
currently being passed into the function that generates the two buttons and
hence defines the reload URL.  I would rather not pass any additional
variables into this function as I just feel this is "unclean".  Thanks again
for the idea, and any additional advice or suggestions are most appreciated.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 9:01 AM
To: NIPP, SCOTT V (SBCSI)
Subject: RE: [PHP-DB] Datetime help in an INSERT...



You could alway place it as a "GET" 

echo ""; 


Gary Every 
Sr. UNIX Administrator 
Ingram Entertainment 
(615) 287-4876 
"Pay It Forward" 
mailto:[EMAIL PROTECTED]
  
http://accessingram.com   


> -Original Message- 
> From: NIPP, SCOTT V (SBCSI) [ mailto:[EMAIL PROTECTED]
 ] 
> Sent: Thursday, June 05, 2003 8:57 AM 
> To: 'CPT John W. Holmes'; [EMAIL PROTECTED] 
> Cc: [EMAIL PROTECTED] 
> Subject: RE: [PHP-DB] Datetime help in an INSERT... 
> 
> 
>   I have actually discovered that the $td value is blank. 
>  The reason 
> appears to be that the page is reloading when a button is 
> pushed, and that 
> is when the $td value is being lost.  My question now is, how 
> do I keep the 
> $td value after the page is reloaded?  I would rather keep 
> the value from 
> the original query than perform another database query to 
> populate this 
> value yet again.  Thanks yet again for the help. 
> 
> -Original Message- 
> From: CPT John W. Holmes [ mailto:[EMAIL PROTECTED]
 ] 
> Sent: Wednesday, June 04, 2003 2:14 PM 
> To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] 
> Cc: [EMAIL PROTECTED] 
> Subject: Re: [PHP-DB] Datetime help in an INSERT... 
> 
> 
> > > I am stumbling across something that I thought I have done before, 
> > > and I am not having any luck finding an example of this.  
> Basically, I 
> am 
> > > wanting to timestamp the date and time into new entries 
> in a simple 
> > database 
> > > table.  The following section is the actual code for 
> this, and I cannot 
> > > figure out how to get the date/time stamp to populate 
> into the database. 
> > > Thanks in advance for the help.  I suspect this is a very 
> simple fix. 
> > > 
> > > $denylog = "INSERT INTO deny (account, td, date) VALUES 
> ($tmp, $td, 
> > NOW())"; 
> > > $denylog_result = mysql_query($denylog, $Prod) or 
> die(mysql_error()); 
> > 
> > The error I am receiving is: 
> > 
> > You have an error in your SQL syntax near ' NOW())' at line 1 
> 
> Are you sure $td has a value? If it's blank, you'd get an 
> error like that. 
> 
> ---John Holmes... 
> 
> -- 
> PHP Database Mailing List ( http://www.php.net/  ) 
> To unsubscribe, visit: http://www.php.net/unsub.php
  
> 



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-06 Thread NIPP, SCOTT V (SBCSI)
I just responded to a separate but similar suggestion.  The form
elements, including the buttons, are all generated in a separate function.
I am currently passing about 5 variables into this function and I am a
little hesitant to pass any others.  I am not sure about complexity,
performance, etc. in passing so many variables into a function.  Please let
me know if anyone has any ideas on this.  I doubt that this is happening,
but I would really like for the code to be as easily maintainable as
possible.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 9:48 AM
To: NIPP, SCOTT V (SBCSI)
Subject: RE: [PHP-DB] Datetime help in an INSERT...


a button is being pressed?
so it is processing a form?
if its in a form just pass along the value of $td via hidden input data...



jay merritt
[EMAIL PROTECTED]
[EMAIL PROTECTED]


>   OK.  I guess the next question would be what is the best option for
> performance?  This portion of the app currently doesn't have any session
> functionality built in.  I would be setting up the session for this sole
> purpose.  I haven't worked with cookies yet.  I suppose the URL method
might
> work, I have just never like it because I think it looks unclean, just
> personal preference there.
>   As to the $td question...  This is a variable that holds the userid
> of the "Technical Director" who is the account approver.  This portion of
> the app is simply an approval mechanism to an account request system that
I
> am developing.  The "TD" receives an e-mail with a link back to the
approval
> page to approve the requested accounts.  This approval then fires off an
> e-mail to the SA responsible for user accounts to inform him to create the
> newly approved account.
>   Well, thanks again for the feedback.  Hopefully I can get this going
> pretty quick.  We are currently planning on rolling this app out to our
user
> community on Monday.  This is the last issue I have that I am aware of.
> 
> -Original Message-
> From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 05, 2003 9:06 AM
> To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Datetime help in an INSERT...
> 
> 
> > I have actually discovered that the $td value is blank.  The reason
> > appears to be that the page is reloading when a button is pushed, and
that
> > is when the $td value is being lost.  My question now is, how do I keep
> the
> > $td value after the page is reloaded?  I would rather keep the value
from
> > the original query than perform another database query to populate this
> > value yet again.  Thanks yet again for the help.
> 
> Stick it in the session? cookie? URL? What is $td?
> 
> ---John Holmes...
> 



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



Re: [PHP-DB] forms with php/mysql

2003-06-06 Thread Philippe Rousselot
Hi,

Thanks all for your answers. 

What I mean by I am not a coder is that it will take me 3 month to do it while 
doing only that, because I code in PHP once a month. And since I help an 
association I cannot really spend my time doing this.

What I can do is to take bits of code and put them toggether without too much 
trouble. I just found php classes repository, it is not bad at all. 

I got most of the elements. 

Philippe

Le Jeudi 5 Juin 2003 12:02, Becoming Digital a écrit :

> > If you aren't a coder, you probably cannot do what you ask; there aren't
> > any pre-built simple systems that do exactly what you ask.
>
> Yes and no.  I agree that someone without coding experience (or a desire to
> learn) cannot tackle this problem, but what Philippe has requested is a
> simple user authentication system with sessions, of which there are many. 
> Still, customization to fit his system will require an understanding of the
> code, which will likely prove problematic.
>
> To the poster, check out the PHP Classes Repository for a number of
> authentication classes.  Don't expect them to work if you don't understand
> the code, though.
>
> Edward Dudlik
> Becoming Digital
> www.becomingdigital.com
>
>
> - Original Message -
> From: "Peter Beckman" <[EMAIL PROTECTED]>
> To: "Philippe Rousselot" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, 05 June, 2003 00:15
> Subject: Re: [PHP-DB] forms with php/mysql
>
>
> 1. Search the archives, they are here: http://www.php.net/mailing-lists.php
>
> 2. If you aren't a coder, you probably cannot do what you ask; there aren't
> any pre-built simple systems that do exactly what you ask.  You could look
> on freshmeat.net or sourceforge.com, but I doubt you'd find what you are
> looking for.
>
> Peter
>
> On Thu, 5 Jun 2003, Philippe Rousselot wrote:
> > Hi,
> >
> > I need for an association to create a form using php/mysql. If I can
> > understand php, I am not a coder, so if someone had the code I need, I
> > would really be greatful.
> >
> > I need :
> >
> > 1. on a page someone identify himself or register to the service using a
> > form where the person enter name, email(username) and password.
> > 2. once registered, the person can access a secured zone containing a
> > form 3. the persone can fill the form, abandon half way and save the
> > result, then come back and have the previously recorded information
> > appearing again.
> >
> > all data need to be in a Mysql database.
> >
> >
> > Thank you very much for your help.
> >
> > Philippe
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> ---
> Peter Beckman  Internet Guy
> [EMAIL PROTECTED] http://www.purplecow.com/
> ---
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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



RE: [PHP-DB] Cookie issue

2003-06-06 Thread Marie Osypian
To add to this message:

We are having problems with people using IE 6.0.  They appear to sign-in and
then are returned to the sign-in screen over and over.  This doesnt happen
to all that use the site.

Thanks in advance

-Original Message-
From: Marie Osypian [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 10:03 AM
To: PHP-DB
Subject: [PHP-DB] Cookie issue


We are having complaints on our site about users not being able to log-in
and we feel it maybe related to the setting of cookie.  Here is the code
used.  Can anyone give me insight.


/* some standard var's or other things like srand */
srand((double)microtime() * 100);
$includes_root  = "$DOCUMENT_ROOT/includes";
$encoded_url= urlencode($REQUEST_URI);

if($_COOKIE["cookie_check"] != "Y")
{
setcookie("cookie_check", "Y", strtotime("+5 years"), "/",
"$HTTP_HOST", 0);
}

if($_COOKIE["current_surfer_id"] == "" AND $_COOKIE["cookie_check"] ==
"Y")
{
$current_surfer_id = rand(0, 16777215);

setcookie("current_surfer_id", $current_surfer_id, strtotime("+5
years"), "/", "$HTTP_HOST", 0);
}



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



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



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-06 Thread NIPP, SCOTT V (SBCSI)
Thought I was on track, but stumped again...

I am now getting a completely different error that I cannot figure
out how it is related.  I have passed the $td variable into the function and
then get it back as a POST variable from a hidden field within the function.
Here is the error I am now seeing;

Unknown column 'sn4265' in 'field list'

This one is really throwing me at the moment as the only place the
value sn4265 is stored is in the $sbcuid variable.  This $sbcuid variable is
not a part of the INSERT that I am performing which I think is generating
this error.  I am guessing that you guys will need more info to help out
with this now.  Just let me know what you want.  Thanks again.

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 10:07 AM
To: NIPP, SCOTT V (SBCSI)
Subject: Re: [PHP-DB] Datetime help in an INSERT...


Just pass the variable to your function. If you're using a form, then make
it a hidden element.

---John Holmes...

- Original Message - 
From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]>
To: "'CPT John W. Holmes'" <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 10:53 AM
Subject: RE: [PHP-DB] Datetime help in an INSERT...


> Do you think URL propagation is a better option than passing another
> variable into the function and then passing it back out through a hidden
> form element?  Here was another snippet from another suggestion on this.
>
> a button is being pressed?
> so it is processing a form?
> if its in a form just pass along the value of $td via hidden input data...
>
> 
>
> jay merritt
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> -Original Message-
> From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 05, 2003 9:53 AM
> To: NIPP, SCOTT V (SBCSI)
> Subject: Re: [PHP-DB] Datetime help in an INSERT...
>
>
> Propagating it in the URL is probably the best method.
>
> ---John Holmes...
>
> - Original Message - 
> From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]>
> To: "'CPT John W. Holmes'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, June 05, 2003 10:44 AM
> Subject: RE: [PHP-DB] Datetime help in an INSERT...
>
>
> > OK.  I guess the next question would be what is the best option for
> > performance?  This portion of the app currently doesn't have any session
> > functionality built in.  I would be setting up the session for this sole
> > purpose.  I haven't worked with cookies yet.  I suppose the URL method
> might
> > work, I have just never like it because I think it looks unclean, just
> > personal preference there.
> > As to the $td question...  This is a variable that holds the userid
> > of the "Technical Director" who is the account approver.  This portion
of
> > the app is simply an approval mechanism to an account request system
that
> I
> > am developing.  The "TD" receives an e-mail with a link back to the
> approval
> > page to approve the requested accounts.  This approval then fires off an
> > e-mail to the SA responsible for user accounts to inform him to create
the
> > newly approved account.
> > Well, thanks again for the feedback.  Hopefully I can get this going
> > pretty quick.  We are currently planning on rolling this app out to our
> user
> > community on Monday.  This is the last issue I have that I am aware of.
> >
> > -Original Message-
> > From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, June 05, 2003 9:06 AM
> > To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP-DB] Datetime help in an INSERT...
> >
> >
> > > I have actually discovered that the $td value is blank.  The reason
> > > appears to be that the page is reloading when a button is pushed, and
> that
> > > is when the $td value is being lost.  My question now is, how do I
keep
> > the
> > > $td value after the page is reloaded?  I would rather keep the value
> from
> > > the original query than perform another database query to populate
this
> > > value yet again.  Thanks yet again for the help.
> >
> > Stick it in the session? cookie? URL? What is $td?
> >
> > ---John Holmes...
> >
> > -- 
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >

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



RE: [PHP-DB] PHP/Mysql Script help.

2003-06-06 Thread Fulco of Scarborough
Thanks for all you wonderful help.  With a little tweaking, and a new
debugging program, I have been able to get the results I want.  Now I'm
going to begin adding some security features.  Again, thanks for you help.

Yours in Service,
Jason Britton
Scar's Legion
http://st.fulco.net
[EMAIL PROTECTED]
 
Vincit imitationem veritas.

> -Original Message-
> From: Becoming Digital [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 05, 2003 4:59 AM
> To: 'PHP-DB'
> Subject: Re: [PHP-DB] PHP/Mysql Script help.
> 
> I debugged the code and there were a slew of errors.  I've fixed all but
one,
> which I can't correct bcs I don't know the intention.  Most of the errors
came
> from improper syntax, a problem which could have been avoided by using
> consistent code formatting.  I chose to do that for you as well and have
> included the code below.
> 
> As for the error I could not correct, it involves the final elseif()
statement.
> The way your code was written, you had two 'else' statements, which is an
> obvious violation.  I corrected that by changing the first (before the
select
> statement) to an elseif(), but I do not know the condition.  Once you
enter it,
> the code should work smoothly.
> 
> 
>  
> require("racesetup.php");
> 
> $con = mysql_connect($host, $user, $pass) or die(mysql_error());
> 
> mysql_select_db($db, $con) or die(mysql_error());
> 
> // display individual record
> if ($id)
> {
> error_reporting(E_ALL);
> 
> $result = mysql_query("SELECT * FROM nuke_race WHERE id=$id",$con) or
> die(mysql_error());
> 
> $myrow = mysql_fetch_array($result) or die(mysql_error());
> 
> printf ("Race: %s\n", $myrow["race"]);
> 
> echo "";
> 
> printf("Description: %s\n", $myrow["racetxt"]);
> 
> echo "";
> echo "Back";
> }
> 
> elseif ($_Post['letter'])
> {
> if ($_Post['letter'])
> {
> $result = mysql_query("SELECT * FROM nuke_race WHERE race LIKE
> $_Post['letter']%",$con) or die(mysql_error());
> if ($myrow = mysql_fetch_array($result))
> {   // display list if there are records to display
> do {
> printf("%s\n", $PHP_SELF,
> $myrow["id"], $myrow["race"]);
> }
> while ($myrow = mysql_fetch_array($result));
> }
> }
> }
> 
> //NO CONDITION LISTED!!
> elseif ()
> {
> echo ""
> 
>   . "  Pick a letter to begin your search"
>   . "   "
>   . ""
>   . "  A"
>   . "  B"
>   . "  C"
>   . "  D"
>   . "  E"
>   . "  F"
>   . "  G"
>   . "  H"
>   . "  I"
>   . "  J"
>   . "  K"
>   . "  L"
>   . "  M"
>   . "  N"
>   . "  O"
>   . "  P"
>   . "  Q"
>   . "  R"
>   . "  S"
>   . "  T"
>   . "  U"
>   . "  V"
>   . "  W"
>   . "  X"
>   . "  Y"
>   . "  Z"
>   . ""
>   . "  "
>   . "   "
>   . " information\">"
>   . "  "
>   . ""
>   ."";
> }
> 
> else
> // no records to display
> echo "Sorry, no records were found!";
> 
> ?>
> 
> 
> Edward Dudlik
> Becoming Digital
> www.becomingdigital.com
> 
> 
> - Original Message -
> From: "Fulco of Scarborough" <[EMAIL PROTECTED]>
> To: "'PHP-DB'" <[EMAIL PROTECTED]>
> Sent: Thursday, 05 June, 2003 00:25
> Subject: Re: [PHP-DB] PHP/Mysql Script help.
> 
> 
> I have still been getting errors, so here goes again.
> 
> 
> 
> I am attempting to design a script that presents the user with a form with
> 26 letters to choose from.  When they pick a letter I want it to take them
> to a list of all the entries in my database that begin with the letter
they
> selected in link form.  When they click on the term, I want it to pull up
> the info for that entry.
> 
> 
> 
> I have made some changes and added some error checking:
> 
> 
> 
>  
> 
> 
> require("racesetup.php");
> 
> $con = mysql_connect($host, $user, $pass) or die(mysql_error());
> 
> 
> 
> mysql_select_db($db, $con) or die(mysql_error());
> 
> 
> 
> // display individual record
> 
> 
> 
> if ($id) {
> 
> error_reporting(E_ALL);
> 
>$result = mysql_query("SELECT * FROM nuke_race WHERE id=$id",$con) or
> die(mysql_error());
> 
> 
> 
>$myrow = mysql_fetch_array($result) or die(mysql_error());
> 
> 
> 
>printf("Race: %s\n", $myrow["race"]);
> 
>   echo "";
> 
>printf("Description: %s\n", $myrow["racetxt"]);
> 
>   echo "";
> 
>   echo "Back";
> 
> 
> 
> 
> } elseif ($_Post['letter']) {
> 
> if ($_Post['letter']) {
> 
> $result = mysql_query("SELECT * FROM nuke_race WHERE race LIKE
> $_Post['letter']%",$con) or die(mysql_error());
> 
> if ($myrow = mysql_fetch_array($result)) {
> 
> 
> 
>   // display list if there are records to display
> 
> 
> 
>   do {
> 
> 
> 
> printf("%s\n", $PHP_SELF,
$myrow["id"],
> $myrow["race"]);
> 
> 
> 
>   } while ($myrow = mysql_f

Re: [PHP-DB] forms with php/mysql

2003-06-06 Thread Philippe Rousselot
done

you can find the files at 

www.alcatorda.com/jcp/test/files.html

and try it at 

www.alctorda.com/jcp/test/enregistrer.php

I am sure it is full of bad codding but it works.

I just have to make it nice now.

Philippe

Le Jeudi 5 Juin 2003 06:15, Peter Beckman a écrit :

> 1. Search the archives, they are here: http://www.php.net/mailing-lists.php
>
> 2. If you aren't a coder, you probably cannot do what you ask; there aren't
> any pre-built simple systems that do exactly what you ask.  You could look
> on freshmeat.net or sourceforge.com, but I doubt you'd find what you are
> looking for.
>
> Peter
>
> On Thu, 5 Jun 2003, Philippe Rousselot wrote:
> > Hi,
> >
> > I need for an association to create a form using php/mysql. If I can
> > understand php, I am not a coder, so if someone had the code I need, I
> > would really be greatful.
> >
> > I need :
> >
> > 1. on a page someone identify himself or register to the service using a
> > form where the person enter name, email(username) and password.
> > 2. once registered, the person can access a secured zone containing a
> > form 3. the persone can fill the form, abandon half way and save the
> > result, then come back and have the previously recorded information
> > appearing again.
> >
> > all data need to be in a Mysql database.
> >
> >
> > Thank you very much for your help.
> >
> > Philippe
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> ---
> Peter Beckman  Internet Guy
> [EMAIL PROTECTED] http://www.purplecow.com/
> ---


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



Re: [PHP-DB] PHP sort from .... best solution?

2003-06-06 Thread A. Lyse
Hi!

Thanks! But I got a problem with the code:

The PHP file as it is with the code pasted into it will i'll past at the end
of this post. The problem is I get the error:

Warning: Invalid argument supplied for foreach() in
/home/amotor/www/list_ingresser_artikler.php on line 43

If I put a // in front of line 32 the script feeds correct, but not sorted.
I think there is a very easy solution to this, but I dont know so mutch PHP
:( I'm reading though.

Thanx alot for the help I got so far. I've learned alot!

Regards,
A. Lyse

The PHP file


publisertLang, $b->publisertLang);
  }



   if($ingresser = array_merge($i1 ,$i2))

   {
$ingresser = usort($ingresser, 'obj_date_compare');
  listIngresser($ingresser);
  }


else
 echo 'Det oppstod en feil ved henting av ingresser.';



function listIngresser($ingresser){
 foreach($ingresser as $i){

  echo '
  

   '.$i->overskrift.' 
    ('.$i->publisert.')

 



'.$i->ingress.'

  
  '
   ;


 }
}



?>


** END PHP file ***



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



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-06 Thread John W. Holmes
>   I am now getting a completely different error that I cannot
figure
> out how it is related.  I have passed the $td variable into the
function
> and
> then get it back as a POST variable from a hidden field within the
> function.
> Here is the error I am now seeing;
> 
> Unknown column 'sn4265' in 'field list'
> 
>   This one is really throwing me at the moment as the only place
the
> value sn4265 is stored is in the $sbcuid variable.  This $sbcuid
variable
> is
> not a part of the INSERT that I am performing which I think is
generating
> this error.  I am guessing that you guys will need more info to help
out
> with this now.  Just let me know what you want.  Thanks again.

Well, if $sbcuid isn't being used, something with its value is. What
does the query look like? Common sense would say that if you're having
trouble with a query, you'd at least post that bit of code, right?

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP-DB] Problem when using browder back button

2003-06-06 Thread Harlan Lax
I am a bit confused.  I have built a web site from dynamic pages using PHP &
Mysql.  When a user selects an item from a drop down list that takes then to
a detail page.  When they click back on the browser button they get a
message about the page has expired.

Is this an issue of session or cookie?  How do I correct this ?



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



RE: [PHP-DB] Problem when using browder back button

2003-06-06 Thread John W. Holmes
> I am a bit confused.  I have built a web site from dynamic pages using
PHP
> &
> Mysql.  When a user selects an item from a drop down list that takes
then
> to
> a detail page.  When they click back on the browser button they get a
> message about the page has expired.
> 
> Is this an issue of session or cookie?  How do I correct this ?

It's an issue of using POST instead of GET and has nothing to do with
PHP. Most browsers won't "re-post" POST data for you for security
reasons. GET, however, is just a URL with a query string, so it simply
requests it. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP-DB] PHP sort from .... best solution?

2003-06-06 Thread Ford, Mike [LSS]
> -Original Message-
> From: A. Lyse [mailto:[EMAIL PROTECTED]
> Sent: 05 June 2003 21:21
> 
> Thanks! But I got a problem with the code:
> 
> The PHP file as it is with the code pasted into it will i'll 
> past at the end
> of this post. The problem is I get the error:
> 
> Warning: Invalid argument supplied for foreach() in
> /home/amotor/www/list_ingresser_artikler.php on line 43
> 
> If I put a // in front of line 32 the script feeds correct, 
> but not sorted.

It would help if you labelled lines 32 and 43, so we don't have to count all up and 
down your posted script to work out which they are.

However, having done the necessary counting, this is your problem line:

> $ingresser = usort($ingresser, 'obj_date_compare');

... in which case, apologies, my bad, because usort does an in-place sort and has no 
return value, so you just want:

   usort($ingresser, 'obj_date_compare');

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP-DB] PHP sort from .... best solution?

2003-06-06 Thread Ford, Mike [LSS]
> -Original Message-
> From: A. Lyse [mailto:[EMAIL PROTECTED]
> Sent: 06 June 2003 11:34

This was sent privately to me, but I'm redirecting the response back to the list in 
case it helps anyone else.

> Feeling kinda stupid. hehe. sorry I didnt label the lines.

Probably no more stupid than I did when I realised I'd got the usort() call wrong...!
 
> You are sure going to laught now for my stupidity, but the aricles are
> listing the wrong way (I'm a bit embarrassed now) Look here:
> http://www.amotor.no/artikler.php
> The last article: formel 1 art 4   (2003 04/06)  is dated 
> forth of june,
> 2003 and the first atricle formel 1 art 1   (2003 28/05) is dated
> twenty-eight of May, 2003. The articles in the between the 
> first and last
> article are sorting from the oldest (the first) to the newest 
> (the last). I
> guess it's not a problem to get this flipped?

No, dead simple -- simply put a - sign in the comparison function:

   function obj_date_compare($a, $b) {
  return -strcmp($a->publisertLang, $b->publisertLang);
   } 

> Sorry, for my bad English. I'm from Norway :(

Your English is fine -- if you hadn't mentioned it, I probably wouldn't have guessed 
that you're not a native speaker!

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP-DB] Problem when using browder back button

2003-06-06 Thread Matthew Horn
> It's an issue of using POST instead of GET and has nothing to do with
> PHP. Most browsers won't "re-post" POST data for you for security
> reasons. GET, however, is just a URL with a query string, so it simply
> requests it. 

Assuming you can't re-write the POST inputs as GETs, is there a way around this so 
users don't have to see that error?

matt

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



RE: [PHP-DB] Problem when using browder back button

2003-06-06 Thread John W. Holmes
> > It's an issue of using POST instead of GET and has nothing to do
with
> > PHP. Most browsers won't "re-post" POST data for you for security
> > reasons. GET, however, is just a URL with a query string, so it
simply
> > requests it.
> 
> Assuming you can't re-write the POST inputs as GETs, is there a way
around
> this so users don't have to see that error?

Don't show any page that's created by a POST operation. If you must use
POST in your forms, use a "middle-man" page that processes the form,
inserts the data into the database or whatever, and redirects using
header() back to another page. Then the user can go back and forth
without issues. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/





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



[PHP-DB] Calling Stored Procedures of Oracle in php

2003-06-06 Thread Ketan Parekh
Hi,

I want  to call a oracle stored procedure from php and retrieve the values.
My procedure has 2 parameters which i have to pass and based on that it will
return values. I am using the below code. I am getting errors like wrong
arguements passed. Can anybody tell me the reason?

$conn = ora_logon("abc","xyz");
 $curs = ora_open($conn);
 $query = "begin prcoedurename('[EMAIL PROTECTED]','3');end;";

 ora_parse($curs, $query);
 ora_exec($curs);
 ora_fetch($curs);

  $nrows = ora_numrows($curs);
  echo $nrows;
  exit;

--

Thanks,

Ketan Parekh
-
Cybage Software Pvt Ltd.
6686359 Ext 235



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



RE: [PHP-DB] Calling Stored Procedures of Oracle in php

2003-06-06 Thread Gary . Every
If this is a cut-n-paste of the code, check the line below for spelling:

"begin prcoedurename('[EMAIL PROTECTED]','3');end;";
  ^^^

Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
"Pay It Forward"
mailto:[EMAIL PROTECTED]
http://accessingram.com


> -Original Message-
> From: Ketan Parekh [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 06, 2003 9:24 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Calling Stored Procedures of Oracle in php
> 
> 
> Hi,
> 
> I want  to call a oracle stored procedure from php and 
> retrieve the values.
> My procedure has 2 parameters which i have to pass and based 
> on that it will
> return values. I am using the below code. I am getting errors 
> like wrong
> arguements passed. Can anybody tell me the reason?
> 
> $conn = ora_logon("abc","xyz");
>  $curs = ora_open($conn);
>  $query = "begin prcoedurename('[EMAIL PROTECTED]','3');end;";
> 
>  ora_parse($curs, $query);
>  ora_exec($curs);
>  ora_fetch($curs);
> 
>   $nrows = ora_numrows($curs);
>   echo $nrows;
>   exit;
> 
> --
> 
> Thanks,
> 
> Ketan Parekh
> -
> Cybage Software Pvt Ltd.
> 6686359 Ext 235
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


[PHP-DB] Transfering variables

2003-06-06 Thread André Sannerholt
Hi everybody!

I'm wondering how to transfer variables in a php-document to the same script
after the form has been submitted!?

Thanks.

André



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



[PHP-DB] MYSQL_CLIENT_COMPRESS

2003-06-06 Thread Armand Turpel
Hi,
Is there any body who have experience with the flags in mysql_connect() in
php >=  4.3 . Especially the MYSQL_CLIENT_COMPRESS flag.

Give it sense, to use this feature if both, apache/php and the mysql server
reside on the same machine?

Thanks,
Armand



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



[PHP-DB] In Addition to 'Transfering variables'

2003-06-06 Thread André Sannerholt
I'm not sure if its get/post I need, beacause the variables are not a part
of the form itself!



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



RE: [PHP-DB] In Addition to 'Transfering variables'

2003-06-06 Thread Hutchins, Richard
We all might benefit from an explanation of what you're trying to do here.

Where does the data in your variables come from?
If the variables are not part of the form itself, what _are_ they part of?
What will be done with the data (e.g., used as query parameters, page
display parameters, etc.)?
Have you researched Sessions?

Rich

> -Original Message-
> From: Andri Sannerholt [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 06, 2003 2:46 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] In Addition to 'Transfering variables'
> 
> 
> I'm not sure if its get/post I need, beacause the variables 
> are not a part
> of the form itself!
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



[PHP-DB] PHP Upgrade question...

2003-06-06 Thread NIPP, SCOTT V (SBCSI)
I know there is another mailing list for installation questions, but
I am hoping for some help here.  I get enough mail from this list alone
without having to join another.  Anyway, while attempting to compile version
4.3.2 I am running into the following error during the configure...


checking whether byte ordering is bigendian... configure: error: can not run
tes
t program while cross compiling

At this point the configure simply dies.  I have no idea on how to
proceed from this.
Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



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



[PHP-DB] Is it worth upgrading Mysql on linux?

2003-06-06 Thread Chris Payne
Hi there everyone,

I run a server from a great company which gives everything you need from $99 a month 
(450 gigs bandwidth, PHP, MySQL, SSL etc ...)

Anyway, I currently run one of the latest builds of PHP but MySQL is only version 
3.23.56 (Or something similar) - does anyone see any advantages of upgrading to 4.0 ?  
 Will I need to recompile PHP to use MySQL 4?  This kind of thing is new to me (Linux 
as I used to use Windows).

Thanks for everything.

Chris

Re: [PHP-DB] Is it worth upgrading Mysql on linux?

2003-06-06 Thread . ma
hi!

if you upgrade i'd say upgrade to 4.1 which provides the IN()-method 
which allows komplex subselects. But may be this is not a very good 
idea cause 4.1 is only alpha afaik

.ma

e: [EMAIL PROTECTED]
w: http://www.abendstille.at

Life would be easier if i knew the source code.
@06.06.03 [21:31] Chris Payne wrote:

Hi there everyone,

I run a server from a great company which gives everything you need 
from $99 a month (450 gigs bandwidth, PHP, MySQL, SSL etc ...)

Anyway, I currently run one of the latest builds of PHP but MySQL is 
only version 3.23.56 (Or something similar) - does anyone see any 
advantages of upgrading to 4.0 ?   Will I need to recompile PHP to use 
MySQL 4?  This kind of thing is new to me (Linux as I used to use 
Windows).

Thanks for everything.

Chris


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


RE: [PHP-DB] Is it worth upgrading Mysql on linux?

2003-06-06 Thread Hutchins, Richard
The following link may be of assistance:

http://www.mysql.com/doc/en/Upgrading-from-3.23.html

> -Original Message-
> From: .ma [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 06, 2003 3:40 PM
> To: PHP-DB
> Subject: Re: [PHP-DB] Is it worth upgrading Mysql on linux?
> 
> 
> hi!
> 
> if you upgrade i'd say upgrade to 4.1 which provides the IN()-method 
> which allows komplex subselects. But may be this is not a very good 
> idea cause 4.1 is only alpha afaik
> 
> .ma
> 
> e: [EMAIL PROTECTED]
> w: http://www.abendstille.at
> 
> Life would be easier if i knew the source code.
> 
> @06.06.03 [21:31] Chris Payne wrote:
> 
> > Hi there everyone,
> >
> > I run a server from a great company which gives everything you need 
> > from $99 a month (450 gigs bandwidth, PHP, MySQL, SSL etc ...)
> >
> > Anyway, I currently run one of the latest builds of PHP but 
> MySQL is 
> > only version 3.23.56 (Or something similar) - does anyone see any 
> > advantages of upgrading to 4.0 ?   Will I need to recompile 
> PHP to use 
> > MySQL 4?  This kind of thing is new to me (Linux as I used to use 
> > Windows).
> >
> > Thanks for everything.
> >
> > Chris
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



[PHP-DB] How to find the last ID?

2003-06-06 Thread Chris Payne
Hi there everyone,

I'm creating a new entry using the following:

mysql_query ("INSERT INTO agents (agent_name) 
   VALUES ('$agentname')

but I need to find out the ID value it created, how can I do this easily?

Thanks

Chris

Re: [PHP-DB] How to find the last ID?

2003-06-06 Thread . ma
hi

you can easily do this by using

mysql_insert_id();

see
http://www.php.net/manual/en/function.mysql-insert-id.php
.ma

e: [EMAIL PROTECTED]
w: http://www.abendstille.at
/***/
life would be easier if i knew the source code.
Am Freitag, 06.06.03 um 23:16 Uhr schrieb Chris Payne:

Hi there everyone,

I'm creating a new entry using the following:

mysql_query ("INSERT INTO agents (agent_name)
   VALUES ('$agentname')
but I need to find out the ID value it created, how can I do this 
easily?

Thanks

Chris




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


Re: [PHP-DB] How to find the last ID?

2003-06-06 Thread Chris Payne
Hi there,

Thanks for your quick reply, very appreciated :-)

Chris

> hi
> 
> you can easily do this by using
> 
> mysql_insert_id();
> 
> see
> http://www.php.net/manual/en/function.mysql-insert-id.php
> 
> .ma
> 
> e: [EMAIL PROTECTED]
> w: http://www.abendstille.at
> /***/
> life would be easier if i knew the source code.
> 
> Am Freitag, 06.06.03 um 23:16 Uhr schrieb Chris Payne:
> 
> > Hi there everyone,
> >
> > I'm creating a new entry using the following:
> >
> > mysql_query ("INSERT INTO agents (agent_name)
> >VALUES ('$agentname')
> >
> > but I need to find out the ID value it created, how can I do this 
> > easily?
> >
> > Thanks
> >
> > Chris
> 
> 


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



Re: [PHP-DB] How to find the last ID?

2003-06-06 Thread Jeff Shapiro

$last_id = mysql_insert_id();

Check out this page for details.
http://www.php.net/manual/en/function.mysql-insert-id.php

On Fri, 6 Jun 2003 17:16:01 -0400, Chris Payne wrote:
> Hi there everyone,
> 
> I'm creating a new entry using the following:
> 
> mysql_query ("INSERT INTO agents (agent_name) 
>VALUES ('$agentname')
> 
> but I need to find out the ID value it created, how can I do this easily?
> 
> Thanks
> 
> Chris

---
Listserv only address.
Jeff Shapiro

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



[PHP-DB] php4.3+apache2+interbase 7 problem

2003-06-06 Thread [EMAIL PROTECTED]
hello,

i am installing Apache 2.0.40 and Php 4.3.1 and Interbase 7 and for some
reason i have problem when my code try to select from a database if the
query is update or insert delete etc. all works well until i try a select.

if i install interbase 6 or lower version then everything is ok.

also i tryed running the interbase as: --with-interbase=shared and load it
as extension but that failed too, also tryed to use an interbase.so of
version 6 when the actual installed interbase is 7 and that worked but
failes when doing transaction and blob stuff - which means - no good

any of you guys out there encountered that kind of problem? any idea ?

thanks ahead gmb.



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



[PHP-DB] Seccond addition: 'Transfering variables'

2003-06-06 Thread André Sannerholt
Ok, the thing I accually want to do is to keep all the entries in one
specific selection-option-box after the form has been submitted. I hope that
is enough of explanation, because I cannot expect from you to go through my
whole project...

Regards, André



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



Re: [PHP-DB] Seccond addition: 'Transfering variables'

2003-06-06 Thread Becoming Digital
Entries from what?  Do you have a code example of what you're working with now?
Believe it or not, most of us would rather read through it than guess what
you're trying to accomplish.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: "André Sannerholt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, 06 June, 2003 17:51
Subject: [PHP-DB] Seccond addition: 'Transfering variables'


Ok, the thing I accually want to do is to keep all the entries in one
specific selection-option-box after the form has been submitted. I hope that
is enough of explanation, because I cannot expect from you to go through my
whole project...

Regards, André



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





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



[PHP-DB] Displaying groups from SELECT

2003-06-06 Thread Becoming Digital
I'm wearing the stupid hat today, so please pardon this.  I know I must be
overlooking something.

I have a small catalogue with two tables (categories, products) from which I'm
trying to display items.  I'm trying to print the contents as below without
using two queries, but I'm having a difficult time with it.

cat1
prod1
prod2
cat2
prod1
prod2
etc.

I think this came up fairly recently, but I cannot for the life of me figure out
what search terms would answer this question.  As you can see from the message
subject, I don't even know how to refer to my problem.  Thanks a lot for all
your help.

Edward Dudlik
Becoming Digital
www.becomingdigital.com




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



Re: [PHP-DB] Displaying groups from SELECT

2003-06-06 Thread Gürhan Özen
On Fri, 2003-06-06 at 21:49, Becoming Digital wrote:
> I'm wearing the stupid hat today, so please pardon this.  I know I must be
> overlooking something.
> 
> I have a small catalogue with two tables (categories, products) from which I'm
> trying to display items.  I'm trying to print the contents as below without
> using two queries, but I'm having a difficult time with it.
> 
> cat1
> prod1
> prod2
> cat2
> prod1
> prod2
> etc.
> 
> I think this came up fairly recently, but I cannot for the life of me figure out
> what search terms would answer this question.  As you can see from the message
> subject, I don't even know how to refer to my problem.  Thanks a lot for all
> your help.
> 
> Edward Dudlik
> Becoming Digital
> www.becomingdigital.com
> 

  Hi Ed, 
 The magic word is "DISTINCT" :)
 
 $query="SELECT DISTINCT(category) AS cat_name FROM table_name";
 $result=mysql_query($query);
 print "";
 while ($row=mysql_fetch_array($result)) {
print "".($row["cat_name"])."";
$query1="SELECT productname FROM tablename WHERE
category=".($row["cat_name"])."";
$result1=mysql_query($query1);
while ($row1=mysql_fetch_array($result1)) {
   print "".($row1["productname"])."";
}
print "";
}
 
print "";


I hope this helps..


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



Re: [PHP-DB] Displaying groups from SELECT

2003-06-06 Thread Becoming Digital
Thanks, Gürhan, but I think I needed to explain things better.  As is generally
a good idea, the categories are referenced in the product table by ID, not name.
Additionally, this is something along the lines of what I already had.  I was
trying to use only one query and make PHP do the remaining work.

Here's the code I'm currently using, which I should have posted in the first
place.

\n";

while ( $cats = mysql_fetch_array( $result ) )
{
print "" .$cats["cat_name"] ."";

$queryB = "SELECT prod_name FROM products
WHERE prod_cat=" .$cats["cat_id"];
$resultB = mysql_query( $queryB );
print "";

while ( $items = mysql_fetch_array( $resultB ) )
{
print "" .$items["prod_name"] ."";
}

 print "";
}

print "";
?>

The more I think about it, the more it seems like I'll just have to use two
queries.  I just didn't want to do so bcs the second query will run at least
four times and it seemed inefficient.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: "Gürhan Özen" <[EMAIL PROTECTED]>
To: "Becoming Digital" <[EMAIL PROTECTED]>
Cc: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Friday, 06 June, 2003 23:07
Subject: Re: [PHP-DB] Displaying groups from SELECT


On Fri, 2003-06-06 at 21:49, Becoming Digital wrote:
> I'm wearing the stupid hat today, so please pardon this.  I know I must be
> overlooking something.
>
> I have a small catalogue with two tables (categories, products) from which I'm
> trying to display items.  I'm trying to print the contents as below without
> using two queries, but I'm having a difficult time with it.
>
> cat1
> prod1
> prod2
> cat2
> prod1
> prod2
> etc.
>
> I think this came up fairly recently, but I cannot for the life of me figure
out
> what search terms would answer this question.  As you can see from the message
> subject, I don't even know how to refer to my problem.  Thanks a lot for all
> your help.
>
> Edward Dudlik
> Becoming Digital
> www.becomingdigital.com
>

  Hi Ed,
 The magic word is "DISTINCT" :)

 $query="SELECT DISTINCT(category) AS cat_name FROM table_name";
 $result=mysql_query($query);
 print "";
 while ($row=mysql_fetch_array($result)) {
print "".($row["cat_name"])."";
$query1="SELECT productname FROM tablename WHERE
category=".($row["cat_name"])."";
$result1=mysql_query($query1);
while ($row1=mysql_fetch_array($result1)) {
   print "".($row1["productname"])."";
}
print "";
}

print "";


I hope this helps..





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



Re: [PHP-DB] Calling Stored Procedures of Oracle in php

2003-06-06 Thread Ketan Parekh
RE: [PHP-DB] Calling Stored Procedures of Oracle in phpYou did not get it. Actually 
the procedure name means Any procedure Name say "getName". It was just an example :-)
  - Original Message - 
  From: [EMAIL PROTECTED] 
  To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  Sent: Friday, June 06, 2003 9:00 PM
  Subject: RE: [PHP-DB] Calling Stored Procedures of Oracle in php


  If this is a cut-n-paste of the code, check the line below for spelling: 

  "begin prcoedurename('[EMAIL PROTECTED]','3');end;"; 
^^^ 

  Gary Every 
  Sr. UNIX Administrator 
  Ingram Entertainment 
  (615) 287-4876 
  "Pay It Forward" 
  mailto:[EMAIL PROTECTED] 
  http://accessingram.com 



  > -Original Message- 
  > From: Ketan Parekh [mailto:[EMAIL PROTECTED] 
  > Sent: Friday, June 06, 2003 9:24 AM 
  > To: [EMAIL PROTECTED] 
  > Subject: [PHP-DB] Calling Stored Procedures of Oracle in php 
  > 
  > 
  > Hi, 
  > 
  > I want  to call a oracle stored procedure from php and 
  > retrieve the values. 
  > My procedure has 2 parameters which i have to pass and based 
  > on that it will 
  > return values. I am using the below code. I am getting errors 
  > like wrong 
  > arguements passed. Can anybody tell me the reason? 
  > 
  > $conn = ora_logon("abc","xyz"); 
  >  $curs = ora_open($conn); 
  >  $query = "begin prcoedurename('[EMAIL PROTECTED]','3');end;"; 
  > 
  >  ora_parse($curs, $query); 
  >  ora_exec($curs); 
  >  ora_fetch($curs); 
  > 
  >   $nrows = ora_numrows($curs); 
  >   echo $nrows; 
  >   exit; 
  > 
  > -- 
  > 
  > Thanks, 
  > 
  > Ketan Parekh 
  > - 
  > Cybage Software Pvt Ltd. 
  > 6686359 Ext 235 
  > 
  > 
  > 
  > -- 
  > PHP Database Mailing List (http://www.php.net/) 
  > To unsubscribe, visit: http://www.php.net/unsub.php 
  > 



[PHP-DB] PHP Problem

2003-06-06 Thread Ramesh PAtel
Hi All

Hi i install PHP4.3 and apache2 now i create one page for PHP Info
i use 
i show all info on web page . 

But Problem is here

When i create one page for Connect Database on PostgreSQL.it not work.
mean Postgresql work well i test it. i thing PHP Command problem.

Please help where is Problem. in PHP Configuration or Apache Configuration.

Ramesh Patel

[EMAIL PROTECTED]


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



Re: [PHP-DB] PHP Problem

2003-06-06 Thread Becoming Digital
Please post the code you are trying to use so that we can try to find the
problem.  Without data, we can't tell you where things went wrong.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: "Ramesh PAtel " <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, 07 June, 2003 01:12
Subject: [PHP-DB] PHP Problem


Hi All

Hi i install PHP4.3 and apache2 now i create one page for PHP Info
i use 
i show all info on web page .

But Problem is here

When i create one page for Connect Database on PostgreSQL.it not work.
mean Postgresql work well i test it. i thing PHP Command problem.

Please help where is Problem. in PHP Configuration or Apache Configuration.

Ramesh Patel

[EMAIL PROTECTED]


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





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



Re: [PHP-DB] Transfering variables

2003-06-06 Thread mike karthauser
on 6/6/03 5:52 pm, André Sannerholt at [EMAIL PROTECTED] wrote:

> I'm wondering how to transfer variables in a php-document to the same script
> after the form has been submitted!?

if ($_POST['submit']) {

//stuff

} else {

// form stuff

}


HTH

-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email   >> [EMAIL PROTECTED]
Web >> http://www.brightstorm.co.uk
Tel >> 0117 9426653 (office)
   07939 252144 (mobile)

Snailmail   >> Unit 8, 14 King Square,
   Bristol BS2 8JJ


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



[PHP-DB] PHP, ODBC, Unable to Connect

2003-06-06 Thread Joseph McDonald
Here is the code (acct # blurred for obvious reason):
##begin paste##

##end paste##

Here is the result:
##being paste##
Warning: SQL error: [Simba Technologies Inc.][SimbaEngine C/S ODBC
Driver][SimbaClient][SimbaClient LNA]Client RPC error. Error = (103) Error
sending message. Trap = (111) Error closing connection. Value = (533)
Endpoint in incorrect state. State = CLOSE_STATE. , SQL state 08S01 in
SQLConnect in C:\Program Files\Apache Group\Apache2\htdocs\CD\query.inc on
line 5

Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in
C:\Program Files\Apache Group\Apache2\htdocs\CD\query.inc on line 5

Warning: odbc_result_all(): supplied argument is not a valid ODBC result
resource in C:\Program Files\Apache Group\Apache2\htdocs\CD\query.inc on
line 6
##end paste##
The server is a custom Simba database wrote to access cfam databases on a
RS/6000 box.   I can pull info from this database using ODBC Explorer, MSQry
tool, and several others, but PHP just will not give me back any data.  I
keep getting this error message.  I have searched online and with no evail.
If anyone can help me with this, I would greatly appreciate it.  I am doing
my best to learn PHP & several database systems but this has put a bump in
my road.  PHP's ODBC does work, I've connected using openlink and progress
server on the same RS/6000 box to a diff database.

Thanks in advance

Joe

I



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