RE: [PHP-DB] saving details problem (big)

2002-04-04 Thread Beau Lebens

Dave,
would it be possible (not ideal, but might work) to do something like this;

 - user fills out form
 - user clicks submit
 - submit fires off 2 events, one submits to AFD server, the other opens a
new window, behind the current, submits certain values (the 3 new ones) and
saves them into the database. this window then automatically closes iteself
once finished
 - whatever happens at AFD then comes back to your next page where you pull
out the last values again and continue working with them

is that feasible for you?

HTH

Beau

// -Original Message-
// From: Dave Carrera [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 5 April 2002 3:11 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] saving details problem (big)
// 
// 
// Hi all
// 
// I am making use of AFD postcode lookup application.
// 
//  
// 
// What it dose is ask for your postcode and returns your address.
// 
// You may have seen this around the web..
// 
//  
// 
// Well my problem is that I have added 3 extra fields 
// 
//  
// 
// Name, email, phone number
// 
//  
// 
// And I need to save this info.
// 
//  
// 
// I have tried sessions and cookies but have just noticed
// 
// That the form action is a cgi file on the afd server. Thus this is
// stopping me
// 
// Saving info.
// 
//  
// 
// Any ideas on how I can save the info.
// 
//  
// 
// I am in a back to the wall situation so any pointer and guidance is
// 
// Most appreciated.
// 
//  
// 
// P.S Had it work all fine and dandy when I added the extra info after
// postcode lookup but customer insisted he wants it this way round.
// Customers...
// 
// (cant live with them, cant live without them...)
// 
//  
// 
// Dave Carrera
// 
// Php Developer
// 
// http://davecarrera.freelancers.net
// 
// http://www.davecarrera.com
// 
//  
// 
//  
// 
// 

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




[PHP-DB] saving details problem (big)

2002-04-04 Thread Dave Carrera

Hi all

I am making use of AFD postcode lookup application.

 

What it dose is ask for your postcode and returns your address.

You may have seen this around the web..

 

Well my problem is that I have added 3 extra fields 

 

Name, email, phone number

 

And I need to save this info.

 

I have tried sessions and cookies but have just noticed

That the form action is a cgi file on the afd server. Thus this is
stopping me

Saving info.

 

Any ideas on how I can save the info.

 

I am in a back to the wall situation so any pointer and guidance is

Most appreciated.

 

P.S Had it work all fine and dandy when I added the extra info after
postcode lookup but customer insisted he wants it this way round.
Customers...

(cant live with them, cant live without them...)

 

Dave Carrera

Php Developer

http://davecarrera.freelancers.net

http://www.davecarrera.com

 

 




Re: [PHP-DB] Databse Access Problem...

2002-04-04 Thread Marius Ursache

do a file called phpinfo.php



see what version of php are you using, then check in manual if your version is
old enough for "ocilogon"

Pusta a écrit :

> A little background information:
>
> Running PHP on Apache server bundled with Oracle Portal on Redhat Linux 7.1.
> Trying to access the Oracle database from the web using PHP and when I write
> the connect statement, I get this error:
>
> Fatal error: Call to undefined function: ocilogon() in
> /home/students/uss/public_html/index.php on line 6
>
> Here is my code:
>
> 
> 
> 
> 
>  $dbconnection = OCILogon("username", "password", "databasename");
> $sql = "SELECT GURMAIL_PIDM FROM GURMAIL_GENERAL";
> $parsedsql = OCIParse($dbconnection, $sql)
>  or die("Unable to Parse");
> OCIExecute($parsedsql) or die("Unable to execute");
> ?>
>
> 
> 
>
> Can anyone help?? Is my code wrong?  Is the PHP server missing something?
>
> Pusta
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
  Marius Ursache (3563 || 3494)

   \|/  \|/
   "@'/ ,. \`@"
   /_| \__/ |_\
  \__U_/



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




Re: [PHP-DB] Databse Access Problem...

2002-04-04 Thread Wayne Bastow

Pusta,

Sounds like Oracle support hasn't been compiled into PHP.

Wayne

Pusta wrote:

>A little background information:
>
>Running PHP on Apache server bundled with Oracle Portal on Redhat Linux 7.1.
>Trying to access the Oracle database from the web using PHP and when I write
>the connect statement, I get this error:
>
>Fatal error: Call to undefined function: ocilogon() in
>/home/students/uss/public_html/index.php on line 6
>
>
>Here is my code:
>
>
>
>
>
>
>
>$dbconnection = OCILogon("username", "password", "databasename");
>$sql = "SELECT GURMAIL_PIDM FROM GURMAIL_GENERAL";
>$parsedsql = OCIParse($dbconnection, $sql)
> or die("Unable to Parse");
>OCIExecute($parsedsql) or die("Unable to execute");
>?>
>
>
>
>
>
>
>Can anyone help?? Is my code wrong?  Is the PHP server missing something?
>
>Pusta
>
>
>



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




[PHP-DB] Databse Access Problem...

2002-04-04 Thread Pusta

A little background information:

Running PHP on Apache server bundled with Oracle Portal on Redhat Linux 7.1.
Trying to access the Oracle database from the web using PHP and when I write
the connect statement, I get this error:

Fatal error: Call to undefined function: ocilogon() in
/home/students/uss/public_html/index.php on line 6


Here is my code:














Can anyone help?? Is my code wrong?  Is the PHP server missing something?

Pusta



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




Re: [PHP-DB] Forms and mysql

2002-04-04 Thread Jason Wong

On Friday 05 April 2002 13:42, Jennifer Downey wrote:
> If you had read more carefully you'd see that I don't have THE email sent
> to me. The replies were never in the archives.

Email & posts, many people don't know/don't differentiate/don't care about 
the difference. Obviously you're not one of them :)

> I guess since I am a woman everyone feels they need to send private email
> instead of replying with a post.

How enviable.


> What I need to accomplish  is that when the submit button is clicked the
> quantity is subtracted by 1 and then the item is placed in the users item
> list in mysql.

You don't say what the problem is. I'm assuming your form works correctly.

> This is what I have in buyitem.php but I cant seem to get it to work.
> $return["quantity"]=("UPDATE {$config["prefix"]}_items set quantity =
> quantity - 1 WHERE id = '$ItemID'");

Your use of variable names is most confusing. $return["quantity"] was holding 
a quantity when in your form, now it's being assigned a query ??

> $result=mysql_query($db["quantity"]);

Is $db["quantity"] meant to be $return["quantity"] ? Or vice-versa? Or is it 
a typo?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
"Why must you tell me all your secrets when it's hard enough to love
you knowing nothing?"
-- Lloyd Cole and the Commotions
*/

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




Re: [PHP-DB] Forms and mysql

2002-04-04 Thread Marius Ursache

if you have full access to internet (no proxy or something) try to search on
news servers (alt.php or oher php related newsgroups)

news server: news2.euro.net or other...

Jennifer Downey a écrit :

> In any case the email or replies are not in the archives. I have searched
> them and came up empty.
>
> "Marius Ursache" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >
> > Jennifer Downey a écrit :
> >
> > > If you had read more carefully you'd see that I don't have THE email
> sent to
> > > me. The replies were never in the archives.
> > > I guess since I am a woman everyone feels they need to send private
> email
> > > instead of replying with a post.
> > >
> >
> > maybe...
> > maybe not... on my NS when i press reply he tries to reply to sender, not
> to
> > [EMAIL PROTECTED] ...
> >
> >
> > >
> > > Jennifer
> > >
> > > "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]...
> > > > On Friday 05 April 2002 07:55, Jennifer Downey wrote:
> > > > > Hi all,
> > > > >
> > > > > I know I've asked this before and wouldn't be asking again if I had
> the
> > > > > email that you people replied back with. Windows took a you know
> what on
> > > me
> > > > > and I had to format the hard drive.
> > > >
> > > > If this has been answered before then search in the archives:
> > > >
> > > >   http://marc.theaimsgroup.com/?l=php-db
> > > >
> > > >
> > > > --
> > > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > > >
> > > > /*
> > > > If Love Were Oil, I'd Be About A Quart Low
> > > > -- Book title by Lewis Grizzard
> > > > */
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
> > >
> > > --
> > > PHP Database Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> >   Marius Ursache (3563 || 3494)
> >
> >\|/  \|/
> >"@'/ ,. \`@"
> >/_| \__/ |_\
> >   \__U_/
> >
> >
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
  Marius Ursache (3563 || 3494)

   \|/  \|/
   "@'/ ,. \`@"
   /_| \__/ |_\
  \__U_/



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




Re: [PHP-DB] Forms and mysql

2002-04-04 Thread Jennifer Downey

In any case the email or replies are not in the archives. I have searched
them and came up empty.

"Marius Ursache" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Jennifer Downey a écrit :
>
> > If you had read more carefully you'd see that I don't have THE email
sent to
> > me. The replies were never in the archives.
> > I guess since I am a woman everyone feels they need to send private
email
> > instead of replying with a post.
> >
>
> maybe...
> maybe not... on my NS when i press reply he tries to reply to sender, not
to
> [EMAIL PROTECTED] ...
>
>
> >
> > Jennifer
> >
> > "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]...
> > > On Friday 05 April 2002 07:55, Jennifer Downey wrote:
> > > > Hi all,
> > > >
> > > > I know I've asked this before and wouldn't be asking again if I had
the
> > > > email that you people replied back with. Windows took a you know
what on
> > me
> > > > and I had to format the hard drive.
> > >
> > > If this has been answered before then search in the archives:
> > >
> > >   http://marc.theaimsgroup.com/?l=php-db
> > >
> > >
> > > --
> > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > >
> > > /*
> > > If Love Were Oil, I'd Be About A Quart Low
> > > -- Book title by Lewis Grizzard
> > > */
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
>   Marius Ursache (3563 || 3494)
>
>\|/  \|/
>"@'/ ,. \`@"
>/_| \__/ |_\
>   \__U_/
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



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




Re: [PHP-DB] Forms and mysql

2002-04-04 Thread Marius Ursache



Jennifer Downey a écrit :

> If you had read more carefully you'd see that I don't have THE email sent to
> me. The replies were never in the archives.
> I guess since I am a woman everyone feels they need to send private email
> instead of replying with a post.
>

maybe...
maybe not... on my NS when i press reply he tries to reply to sender, not to
[EMAIL PROTECTED] ...


>
> Jennifer
>
> "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > On Friday 05 April 2002 07:55, Jennifer Downey wrote:
> > > Hi all,
> > >
> > > I know I've asked this before and wouldn't be asking again if I had the
> > > email that you people replied back with. Windows took a you know what on
> me
> > > and I had to format the hard drive.
> >
> > If this has been answered before then search in the archives:
> >
> >   http://marc.theaimsgroup.com/?l=php-db
> >
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> >
> > /*
> > If Love Were Oil, I'd Be About A Quart Low
> > -- Book title by Lewis Grizzard
> > */
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
  Marius Ursache (3563 || 3494)

   \|/  \|/
   "@'/ ,. \`@"
   /_| \__/ |_\
  \__U_/



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




Re: [PHP-DB] Forms and mysql

2002-04-04 Thread Jennifer Downey

If you had read more carefully you'd see that I don't have THE email sent to
me. The replies were never in the archives.
I guess since I am a woman everyone feels they need to send private email
instead of replying with a post.

Jennifer

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Friday 05 April 2002 07:55, Jennifer Downey wrote:
> > Hi all,
> >
> > I know I've asked this before and wouldn't be asking again if I had the
> > email that you people replied back with. Windows took a you know what on
me
> > and I had to format the hard drive.
>
> If this has been answered before then search in the archives:
>
>   http://marc.theaimsgroup.com/?l=php-db
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> If Love Were Oil, I'd Be About A Quart Low
> -- Book title by Lewis Grizzard
> */


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



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




Re: [PHP-DB] viewing records

2002-04-04 Thread Jason Wong

On Friday 05 April 2002 03:35, Natividad Castro wrote:
> Hi to all,
> I created an application that uses authentication. When the user enters the
> username and password, if it is valid, he will have access to the first
> record, which I'm displaying in a form. My question is: can another user
> view the same record at the  same time?


You mean by looking over the first user's shoulder? Probably, unless the 
first user completely blocked the monitor.



> if the answer is yes, is there any
> way to prevent this?

Isn't this what your authentication scheme is supposed to prevent?

> The reason I'm asking is because some information will be copied and pasted
> to a mainframe computer from the form.
>
> Any idea?

In general, if your authentication scheme is working as it should then other 
users should not be able to access your data without authentication. Obvious 
really.

Without knowing what your authentication scheme is we can't really comment on 
how secure it is.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
"I'd love to go out with you, but the last time I went out, I never came 
back."
*/

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




Re: [PHP-DB] Forms and mysql

2002-04-04 Thread Jason Wong

On Friday 05 April 2002 07:55, Jennifer Downey wrote:
> Hi all,
>
> I know I've asked this before and wouldn't be asking again if I had the
> email that you people replied back with. Windows took a you know what on me
> and I had to format the hard drive.

If this has been answered before then search in the archives:

  http://marc.theaimsgroup.com/?l=php-db


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
If Love Were Oil, I'd Be About A Quart Low
-- Book title by Lewis Grizzard
*/

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




[PHP-DB] mail function help

2002-04-04 Thread CrossWalkCentral

For some reason the mail command will not work on all systems mybe I am
using it wrong can some one provide some feedback on this.

here is a code snip.

$msg = "\tFirst Name: $custfname\n

\tLast Name: $custlname\n

\tEmail Address: $custemail\n

\tCategory: $dservice\n

\tDescription: $custpdes\n";

$recipient = "$custcatergory";

$subject = "$adminsubsupport";

$mailheaders = "From: $adminfrmsupport <> \n";

$mailheaders .= "Reply-To: $email\n\n";

mail($recipient, $subject, $msg, $mailheaders);




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




[PHP-DB] Time diference

2002-04-04 Thread Clever

Hi,
I need to build a piece of code do calculate the total working time of a
employee.
I have the tables:

#
# Table structure for table 'card_ticks'
#

CREATE TABLE card_ticks (
  cod bigint(20) unsigned NOT NULL auto_increment,
  tick datetime ,
  employee int(10) unsigned NOT NULL DEFAULT '0' ,
  PRIMARY KEY (Cod)
);

#
# Table structure for table 'employes'
#

CREATE TABLE employes (
  cod int(3) unsigned NOT NULL auto_increment,
  nameme char(30) NOT NULL DEFAULT '' ,
  pass char(50) NOT NULL DEFAULT '' ,
  PRIMARY KEY (cod)
);

The table card_ticks is "feeded" by a system connected to a serial port
where each time the employee pass a card into a machine a record is inserted
on the table.

Generally, a employee has 4 card_tick's by day, for example
1,2002-04-02 23:51:48,3
2,2002-04-02 23:52:00,7
3,2002-04-02 23:52:09,5
4,2002-04-02 23:52:14,3
5,2002-04-02 23:52:23,8
6,2002-04-02 23:52:32,1
7,2002-04-02 23:52:40,3
8,2002-04-03 00:04:39,3
9,2002-04-03 00:08:45,3
10,2002-04-03 00:11:23,3
11,2002-04-03 00:20:26,3

I have to write the code to do something like this
Calculate the total working time in a month for employee 3.
Any sugestions?




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




[PHP-DB] Forms and mysql

2002-04-04 Thread Jennifer Downey

Hi all,

I know I've asked this before and wouldn't be asking again if I had the
email that you people replied back with. Windows took a you know what on me
and I had to format the hard drive.

Anyway here is what I have.

This is items.php:

";

echo "$return[name]";
echo "Quantity $return[quantity]";
echo "Cost: $return[price] SC";
echo "";
?>


What I need to accomplish  is that when the submit button is clicked the
quantity is subtracted by 1 and then the item is placed in the users item
list in mysql.

This is what I have in buyitem.php but I cant seem to get it to work.
$return["quantity"]=("UPDATE {$config["prefix"]}_items set quantity =
quantity - 1 WHERE id = '$ItemID'");
$result=mysql_query($db["quantity"]);

Would someone be kind enough to help with this?


Thanks for all your help so far.
And thanks in advance.
Jennifer


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



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




[PHP-DB] how to question...

2002-04-04 Thread jas

Ok here is what I would like to accomplish, I am sure someone has done
something like this but I need an example to go from since I am still not
able to write php from scratch...
I need to write a function to count the contents of a directory, like the
file names and place them into an array so I can use a select box to select
the file path in which I would like to save to database, like I said I don't
want someone to do it for me, I just need a resource such as a tutorial or
example to run with. Thanks a ton,
Jas



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




Re: [PHP-DB] Editing/Updating Data with Forms

2002-04-04 Thread DL Neil

Josh,
Look up JaneBuilder (or something like See Jane Code) in Google.
This pkg will generate basic HTML forms from a MySQL (etc) db tbl
schema.
A bit basic, but possibly enough to get you where you're going...
=dn

- Original Message -
From: "Jonathan Hilgeman" <[EMAIL PROTECTED]>
To: "'Evans, Josh'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: 04 April 2002 17:50
Subject: RE: [PHP-DB] Editing/Updating Data with Forms


> Just look at your basic PHP tutorials like Devshed's PHP 101:
> http://www.devshed.com/Server_Side/PHP/PHP101
>
> - Jonathan
>
> -Original Message-
> From: Evans, Josh [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 04, 2002 7:31 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Editing/Updating Data with Forms
>
>
> Can anyone help me with editing/updating data in a table with using a
form?
>
> Josh Evans
> ACS Helpdesk
> [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
>
>


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




[PHP-DB] viewing records

2002-04-04 Thread Natividad Castro

Hi to all,
I created an application that uses authentication. When the user enters the
username and password, if it is valid, he will have access to the first
record, which I'm displaying in a form. My question is: can another user
view the same record at the  same time? if the answer is yes, is there any
way to prevent this?
The reason I'm asking is because some information will be copied and pasted
to a mainframe computer from the form.

Any idea?

Thanks in advanced
Nato


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




[PHP-DB] Re: [PHP] New to PHP Need Help

2002-04-04 Thread Philip Olson

Firstly, cross-posting like this is a huge 
no-no, please don't do that again.

> When the script runs it displays Array.  

Printing arrays directly will do that.  Logically 
speaking, how do you expect PHP to know what 
value to get here?  You are SELECTing many.

> I am running WIN2K and IIS 5

I'm sorry ;)

> echo "Camp Street Cafe";
>
> Here is the script that is called.
> 
>  
> $db = mysql_connect("localhost", "", "")
>  or die ("Could not connect to Localhost");
> mysql_select_db ("ETM", $db)
>  or die ("Could not connect to the Database");

If you start running into problems, please 
consider mysql_error()

> $table = "locations";
> $location = ($_REQUEST["location"]);

No need for the () here.

> $query = "Select * from $table where Location_ID = $location";

Notice how you're selecting many columns here, not just one.

> $result= mysql_query($query);
> $Location_Info = mysql_fetch_row($result);

Looking in the manual, the entry for mysql_fetch_row 
tells us:

mysql_fetch_row -- Get a result row as an enumerated array
  array mysql_fetch_row ( resource result)

So it returns an array.  If you prefer the _row format 
then continue to use it, for example using list():

  list($id, $name, $email) = mysql_fetch_row($result);

Or just:

  $row = mysql_fetch_row($result);
  print $row[0]; // This is an enumerated array (numerical)
  print $row[1];

Or use a function like mysql_fetch_assoc instead:

  $row = mysql_fetch_assoc($result);
  print $row['id']; // with id being a column name
// selected via the query
  print $row['name'];

And lastly, if you're not going to use all the data, 
don't SELECT * of it.

Good start, keep it going :)

Regards,
Philip Olson


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




[PHP-DB] HTTP authentication

2002-04-04 Thread John Hughes

Earlier I posted a question about why the failure message in my HTTP
authentication script wasn't working. I figured out the answer. There
was no place to go if the user entered a username or password that
wasn't in the database. 

Below is the corrected code.

John Hughes

\n");
} #END IF ON SQL CHECK DB RESULT 
} ELSE { //SEND headers to request username and password
   header("WWW-Authenticate: Basic realm='The Letters Realm'");
   header("HTTP/1.0 401 Unauthorized");
   //show failure text if user presses cancel
   print("This directory requires a user name and password.\n");
}
?>

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




RE: [PHP-DB] Editing/Updating Data with Forms

2002-04-04 Thread Jonathan Hilgeman

Just look at your basic PHP tutorials like Devshed's PHP 101:
http://www.devshed.com/Server_Side/PHP/PHP101

- Jonathan

-Original Message-
From: Evans, Josh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 7:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Editing/Updating Data with Forms


Can anyone help me with editing/updating data in a table with using a form?

Josh Evans 
ACS Helpdesk
[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] grouping by category

2002-04-04 Thread Jonathan Hilgeman

Hi Big Al,
You're just running full-steam ahead into these mailing lists. :)

Anyhow, as olinux pointed out, you can get everything you want in one query,
but I would choose a different query (no need to GROUP BY category), and
then use a multi-dimensional array to organize the data. Here's my version
of your code:

 $Value)
{
// Store all fields except for num and category, because
// we already have those.
if(($ColumnName != "num") && ($ColumnName != "category"))
{
$Reviews[$Category][$ReviewNum][$ColumnName] =
$Value;
}
}
}
// Add reviews to a multi-dimensional array - END

/*
Now you should have an array that looks like:
$Reviews["Video Cards"][1]["author"] = "Chuck Jones";
$Reviews["Video Cards"][1]["url"] = "http://www.chuckjones.com";;
$Reviews["Video Cards"][1]["some_other_col_name"] = "col_value";

$Reviews["Video Cards"][6]["author"] = "Bill Smith";
$Reviews["Video Cards"][6]["url"] = "http://www.billsmith.com";;
$Reviews["Video Cards"][6]["some_other_col_name"] = "col_value";

$Reviews["Memory"][3]["author"] = "Joe Bob";
$Reviews["Memory"][3]["url"] = "http://www.joebob.net";;
$Reviews["Memory"][3]["some_other_col_name"] = "col_value";
*/

// Go through array
foreach($Reviews as $CategoryName => $SingleReview)
{
// Print out the category name
print "" . $CategoryName . "";

// List all the reviews
foreach($SingleReview as $ReviewNum => $ReviewDetails)
{
print "- " . $ReviewDetails["name"] . " (Written by: " .
$ReviewDetails["author"] . ")";
}
}
?>

Now, that should give you a real basic listing looking like:

Category 1
- Review Name (Written by: Author)
- Review Name (Written by: Author)

Category 2
- Review Name (Written by: Author)
- Review Name (Written by: Author)

There are some nice perks about the above code. If you added, for instance,
a field called "rating" to the database, and you wanted to display the value
in the listings, all you would need to do is to add "rating" to your
beginning SELECT statement. At that point, it would instantly be available
in the bottom $ReviewDetails array as $ReviewDetails["rating"].

The multi-dimensional arrays are a little hard to grasp at first, but they
can make things a lot easier to read/understand, which is what I strive for
in my coding (over speed). You never know who will one day read your code...

- Jonathan

-Original Message-
From: Alex Behrens [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 6:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] grouping by category


Hey Guys,

I'm trying to get my script to group all my reviews by category now but now
it just displays them all in a row a bunch of times and doesn't group them
how I want it to group them. I want it too look like this:

Processor Reviews
- Review
- Review

Motherboard Reviews
- Review
-Review

Heres my syntax, and the page is online here
(http://www.hardware-unlimited.com/hardware2.php) so you can see how it is
executed now:

";
echo "- $name (Written by: mailto:$email\";>$author) - [Description]";

 }  // end review while
} //  end category while
?>

What do I need to do?

Thanks!

-Alex "Big Al" Behrens
E-mail: [EMAIL PROTECTED]
Urgent E-mail: [EMAIL PROTECTED] (Please be brief!)
Phone: 651-482-8779
Cell: 651-329-4187
Fax: 651-482-1391
ICQ: 3969599
Owner of the 3D-Unlimited Network:
http://www.3d-unlimited.com
Send News:
[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] Please help count ?

2002-04-04 Thread Rosser, Chris

Dave,

Try:

$postcode_parts = explode(" ", $postcode);

The first part of the postcode will be available in $postcode_parts[0].


- Chris


> -Original Message-
> From: Dave Carrera [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, April 04, 2002 5:29 PM
> To:   [EMAIL PROTECTED]
> Subject:  [PHP-DB] Please help count ?
> 
> Hi All
> 
>  
> 
> I have a variable returned by my application.
> 
>  
> 
> For clarity it is a post code so result could be
> 
>  
> 
> EX3 T56 or BG56 G67 or CA2 123
> 
>  
> 
> But I only need the first bit of the postcode to continue my search.
> 
>  
> 
> How do I set my var to only include the first bit of the postcode.
> 
>  
> 
> It is returned in the format shown, so my question might be how I read
> only the first bit before the space.
> 
>  
> 
> I fully appreciate any kind of help with this and as always thank you in
> advance for any help.
> 
>  
> 
>  
> 
>  
> 
> Dave Carrera
> 
> Php Developer
> 
> http://davecarrera.freelancers.net
> 
> http://www.davecarrera.com
> 
>  
> 
>  
> 

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




RE: [PHP-DB] Please help count ?

2002-04-04 Thread Rick Emery

$post = ereg_replace("(.*) ","\\1", $old_post);

If you want to search mysql for this that is something else

-Original Message-
From: Dave Carrera [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 10:29 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Please help count ?


Hi All

 

I have a variable returned by my application.

 

For clarity it is a post code so result could be

 

EX3 T56 or BG56 G67 or CA2 123

 

But I only need the first bit of the postcode to continue my search.

 

How do I set my var to only include the first bit of the postcode.

 

It is returned in the format shown, so my question might be how I read
only the first bit before the space.

 

I fully appreciate any kind of help with this and as always thank you in
advance for any help.

 

 

 

Dave Carrera

Php Developer

http://davecarrera.freelancers.net

http://www.davecarrera.com

 

 


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




Re: [PHP-DB] Please help count ?

2002-04-04 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


you can do this...

$myvar = ecplode(' ', $postcode);
$firsthalf = $myvar[0];

But not everyone puts the space in there

S

On Thursday 04 April 2002 5:29 pm, Dave Carrera wrote:
> Hi All
>
>
>
> I have a variable returned by my application.
>
>
>
> For clarity it is a post code so result could be
>
>
>
> EX3 T56 or BG56 G67 or CA2 123
>
>
>
> But I only need the first bit of the postcode to continue my search.
>
>
>
> How do I set my var to only include the first bit of the postcode.
>
>
>
> It is returned in the format shown, so my question might be how I read
> only the first bit before the space.
>
>
>
> I fully appreciate any kind of help with this and as always thank you in
> advance for any help.
>
>
>
>
>
>
>
> Dave Carrera
>
> Php Developer
>
> http://davecarrera.freelancers.net
>
> http://www.davecarrera.com

- -- 
Shane
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8rH/75DXg6dCMBrQRAlEUAJ9R/jfY0Ufdj5yCSiTRw7qB81B3TwCeJELP
GW03u2HKvFXy9fDEEdV1lfg=
=xALC
-END PGP SIGNATURE-


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




[PHP-DB] No logro tomar los datos de un formulario

2002-04-04 Thread Sergio Cornejo

Hola.

Estoy tratando de generar una respuesta a un formulario pero no logro que el
PHP tome los datos que bienen.

trabajo con apache para win 1.2, PHP 4, Dreamweaver 4 y MySQL 3.1

he aqui los códigos de los archivos en cuestion:

el formulario:

-



  
  Tu nombre 
  Tu sistema favorito
  
Linux
Unix
Macintosh
Windows
  
  ¿Te gusta el futbol ? 
  ¿Cual es tu sexo?
  
Hombre
Mujer 
  
  Aficiones
  
  
  



--

el PHP:

---


" . $nombre . " que tal estás\n";
   echo "Eres " . $sexo . "\n";
   echo "Tienes " . $edad . "\n";
   echo "Tu sistema favorito es " . $sistema . "\n";
   if ($futbol) {
  echo "Te gusta el futbol \n";
  } else {
echo "NO te gusta el futbol \n";
}
   if ($aficiones != "") {
  echo "Tus aficiones son: \n";
  echo nl2br($aficiones);
  } else {
echo "NO tienes aficiones \n";
}
   }
echo "VOLVER AL FORMULARIO"
?>


--

Puede alguien ayudarme?

Sergio



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




[PHP-DB] Please help count ?

2002-04-04 Thread Dave Carrera

Hi All

 

I have a variable returned by my application.

 

For clarity it is a post code so result could be

 

EX3 T56 or BG56 G67 or CA2 123

 

But I only need the first bit of the postcode to continue my search.

 

How do I set my var to only include the first bit of the postcode.

 

It is returned in the format shown, so my question might be how I read
only the first bit before the space.

 

I fully appreciate any kind of help with this and as always thank you in
advance for any help.

 

 

 

Dave Carrera

Php Developer

http://davecarrera.freelancers.net

http://www.davecarrera.com

 

 




RE: [PHP-DB] New to PHP Need Help

2002-04-04 Thread Rick Emery

Jason,

If you don't have one, I would also recommend a good book that combines PHP
and MYSQL interaction.  I would strongly suggest the one I cut my PHP teeth
on:

PHP Essentials by Julie Meloni

-Original Message-
From: Julie Meloni [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 10:18 AM
To: Jason Tobias
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] New to PHP Need Help


JT> $Location_Info = mysql_fetch_row($result);

JT> echo "$Location_Info";


After you fetch the row, you have to extract the elements from the
array that makes up the row.  For more than one row in your result, you have
to call
mysql_fetch_row() again.

>From http://www.php.net/manual/en/function.mysql-fetch-row.php :
mysql_fetch_row -- Get a result row as an enumerated array

Examples of using this function follow on the manual page.

I would venture to guess that what you really want to use would be
mysql_fetch_array(), which also produces an array of results, but
_all_ of the rows, not just the first one (and thus does not require
additional calls to the function).

>From http://www.php.net/manual/en/function.mysql-fetch-array.php :
mysql_fetch_array --  Fetch a result row as an associative array, a numeric
array, or both.

With examples also on the manual page.


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


-- 
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] New to PHP Need Help

2002-04-04 Thread Julie Meloni

JT> $Location_Info = mysql_fetch_row($result);

JT> echo "$Location_Info";


After you fetch the row, you have to extract the elements from the
array that makes up the row.  For more than one row in your result, you have to call
mysql_fetch_row() again.

>From http://www.php.net/manual/en/function.mysql-fetch-row.php :
mysql_fetch_row -- Get a result row as an enumerated array

Examples of using this function follow on the manual page.

I would venture to guess that what you really want to use would be
mysql_fetch_array(), which also produces an array of results, but
_all_ of the rows, not just the first one (and thus does not require
additional calls to the function).

>From http://www.php.net/manual/en/function.mysql-fetch-array.php :
mysql_fetch_array --  Fetch a result row as an associative array, a numeric array, or 
both.

With examples also on the manual page.


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




[PHP-DB] RE: [PHP] New to PHP Need Help

2002-04-04 Thread Rick Emery

change:
$Location_Info = mysql_fetch_row($result);

to:
$row = mysql_fetch_array($result);
$Location_Info = $row['fieldname'];

replace "fieldname" with the real name of your database field

-Original Message-
From: Jason Tobias [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 9:29 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [PHP] New to PHP Need Help


I am trying to define variables through an anchor tag to retrive data from
MySQL,  When the script runs it displays Array.  I am running WIN2K and IIS
5

echo "Camp Street Cafe";

Here is the script that is called.

$Location_Info";

?>






-- 
PHP General 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] How to link a MYSQL table to a dbase file

2002-04-04 Thread Gurhan Ozen

Hi Marij,
Cron is a tool in UNIX/LINUX server used to execute commands/programs
automatically in a fixed period basis. You can always read unix man pages to
learn more , just type man cron and man crontab. You may also want to see
this link:

   http://www.faqts.com/knowledge_base/view.phtml/aid/1005/fid/436

Gurhan Ozen
MCI WorldCom
Quality Assurance Team
[EMAIL PROTECTED]
ph:   703-449-4754
Vnet: 228-4754
AIM:  Greywolf1923

-Original Message-
From: Marij Bellen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 9:57 AM
To: Php-Db@Lists. Php.Net (E-mail)
Subject: Re: [PHP-DB] How to link a MYSQL table to a dbase file


I run my site on a linux webserver.
I don't really know what a cron is?
I can also get a csv file.
I also have a function to translate the dbase-file to sql.

Is a cron a tool or whatever to automatically load data into the database?

==
Can you use a cron (Unix) or at (Windows) job to dump the dbase data to a
 comma-separated-value table? Then suck up the csv into the mysql databasde.

=
>
> How can I extract data for a mysql-table from a dbase file?
>
>
> This is the situation:
> 1) we have a dbase-file with data
> 2) the dbase-file is put on the server
> 3) we have a mysql-table that needs to get his data out of this
dbase-file.
>
> How can I link this mysql-table to this file!
>
> !!note:
> ---
> I don't mean how I can put the data of the dbase-file into the table,
> but the table should be linked to the dbase file to get its data!
>
> Background:
> ---
> we want to upload a file with data from our own local database each night
> to our internet-mysql-database.
>
> In MS-access such a file is called a 'external table.'
>
> If this isn't possible and we don't have the ability to use the
> php-dbase-functions (because of our provider),
>
> is there another solution to get the data from the dbase-file
automatically
> in the mysql-database?
>
> Can you help me!!
>
> Thanks.
>
>
>
> --
> PHP Database Mailing List (
> To unsubscribe, visit: 


--
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] New to PHP Need Help

2002-04-04 Thread Jason Tobias

I am trying to define variables through an anchor tag to retrive data from
MySQL,  When the script runs it displays Array.  I am running WIN2K and IIS
5

echo "Camp Street Cafe";

Here is the script that is called.

$Location_Info";

?>






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




RE: [PHP-DB] How to link a MYSQL table to a dbase file

2002-04-04 Thread Rick Emery

cron is an application/utility on ALL unix servers.  It is used to execute
ANY unix command or script at specified dates, times, etc.
type the following to learn more:
man cron
man ctrontab

your cron job would execute the command to translate the dbase file to sql.
Then execute mysql to read in the sql file


-Original Message-
From: Marij Bellen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 8:57 AM
To: Php-Db@Lists. Php.Net (E-mail)
Subject: Re: [PHP-DB] How to link a MYSQL table to a dbase file 


I run my site on a linux webserver.
I don't really know what a cron is?
I can also get a csv file.
I also have a function to translate the dbase-file to sql.

Is a cron a tool or whatever to automatically load data into the database?

==
Can you use a cron (Unix) or at (Windows) job to dump the dbase data to a
 comma-separated-value table? Then suck up the csv into the mysql databasde.
 
=
> 
> How can I extract data for a mysql-table from a dbase file?
> 
> 
> This is the situation:
> 1) we have a dbase-file with data
> 2) the dbase-file is put on the server
> 3) we have a mysql-table that needs to get his data out of this
dbase-file.
> 
> How can I link this mysql-table to this file!
> 
> !!note:
> ---
> I don't mean how I can put the data of the dbase-file into the table,
> but the table should be linked to the dbase file to get its data!
> 
> Background:
> ---
> we want to upload a file with data from our own local database each night
> to our internet-mysql-database.
> 
> In MS-access such a file is called a 'external table.'
> 
> If this isn't possible and we don't have the ability to use the
> php-dbase-functions (because of our provider),
> 
> is there another solution to get the data from the dbase-file
automatically
> in the mysql-database?
> 
> Can you help me!!
> 
> Thanks.
> 
> 
> 
> -- 
> PHP Database Mailing List (
> To unsubscribe, visit: 


-- 
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] Editing/Updating Data with Forms

2002-04-04 Thread Bob

Sounds like you're more in need of a consultant than a mailing list..

Bob
- Original Message -
From: "Evans, Josh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 04, 2002 8:30 AM
Subject: [PHP-DB] Editing/Updating Data with Forms


> Can anyone help me with editing/updating data in a table with using a
form?
>
> Josh Evans
> ACS Helpdesk
> [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] Editing/Updating Data with Forms

2002-04-04 Thread Rick Emery

Josh,

Your question is too vague to answer.
Do you know mysql?
Do you know PHP or PERL?

If not, learn these, then ask.
If so, create code, then ask

-Original Message-
From: Evans, Josh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 9:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Editing/Updating Data with Forms


Can anyone help me with editing/updating data in a table with using a form?

Josh Evans 
ACS Helpdesk
[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




[PHP-DB] HTTP authentication script failure display

2002-04-04 Thread John Hughes

I have adapted a HTTP authentication script from Leon Atkinson's Core PHP
book. I've done something that stopped the failure message from displaying.

The password request works and valid users are sent to the correct page. But
instead of getting "This directory requires a user name and password" when a
failure occurs, I get a blank screeen.  I've compared the code in the book
with mine but I can't see what I've done.  Any help would be appreciated.

John Hughes





\n");
}

?>


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




RE: [PHP-DB] Database Sorting by date

2002-04-04 Thread Rick Emery

Ron,

This would indicate that $table was not set.  Or that the table indicated in
$table does not exist.  Print out $query; is it as you expected?
Enter the SELECT at the mysql command prompt: what is the result?

-Original Message-
From: Allen, Ronald L CIV [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 8:41 AM
To: Rick Emery
Subject: RE: [PHP-DB] Database Sorting by date


The query fails when I try to look at a month it says "Query Failed"

>Ronald L. Allen (MCSE NT, MCP, CCNA)
SR. LAN/WAN Administrator 
>SFOR - Hungary, Croatia
>[EMAIL PROTECTED]
>[EMAIL PROTECTED]
>+36-82-50 ext. 22580
>  DSN: 760-2000


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 04, 2002 16:43
To: 'Ron Allen'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Database Sorting by date


Ron,

What problem are you having?  I'm looking at your code, and it's so clean, I
could eat off of it. My only suggestion would be that $month will NEVER ==
"NULL".  If you are testing for NULL, the test is: if ($month == NULL )

Second, $month will be assigned a value, so it will never be NULL either.

BTW, what is in drop.inc?

-Original Message-
From: Ron Allen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 8:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Database Sorting by date


Here is the problem I want to be able to view all or search through the
currency lists in the database by the month. Any help would be great!!!

Here is the code



   Select a CCSD:
SELECT
VIEW ALL
March 2002
April 2002
May 2002
June 2002
July 2002
August 2002
September 2002
October 2002
November 2002
December 2002




\n";
echo "DATEEURO
EURO
RECONVERSIONKMKM
RECONVERSIONHUFKUNA\n";
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_array($result); //get a row from our result set
if($i % 2) { //this means if there is a remainder
echo "\n";
} else { //if there isn't a remainder we will do the else
echo "\n";
}
echo
"".$row['DATE']."".$row['EURO']."".$row['EURORECON']."
".$row['KM']."".$row['KMRECON']."".$row['HUF']."<
/TD>".$row['KUNA']."\n";
echo "\n";
}
//now let's close the table and be done with it
echo "\n";
?>




-- 
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] Editing/Updating Data with Forms

2002-04-04 Thread Evans, Josh

Can anyone help me with editing/updating data in a table with using a form?

Josh Evans 
ACS Helpdesk
[EMAIL PROTECTED]


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




[PHP-DB] Re: [PHP-DB] Updating Forms Values

2002-04-04 Thread Bzdpltd

Hi there again.
I have tried using the urlencode method but for some reason it is still doing
the same thing and stripping the rest of the name.

I will try to explain more how this works.

I have a site where you login using a name and passord. These values are
stored using cookies and we have the cookie script on each page before the
headers to check to see if the user is allowed at the page there are trying
to access.

This is working fine until we come to editing or adding records.

What happens is the name is tagged onto the standard url links on each page.
So therefore knowing what records to show according to which user is logged
into the system.

Now I have tried using the urlencode but for some reason it just does not
seem to work.

Basically when the user of the system adds or edits a new record, once they
click submit and are taken to the next page which either updates or adds the
new entry, the links which takes them back to the start of the system loses
the end of there name as there is a a space between there first and second
name. 

I have pasted the code which updates the record in the database, together
with some of the other code on the page.

The cookie is at the top and if you look at the link to go back to the index
it contains a urlencode there.

I hope someone can help as I am pulling my hair on this one.

Many thanks
Barry
*
Welcome to secret page A, authorized user!";
 
} else {
 header("Location: http://*/administration/error.php";);
 exit;
}
?>



edited






































| back to my
clients | log out |




















Case Study
Updated.\n");
}
  echo ("");
  echo ("");
  echo ("");
?>












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




FW: [PHP-DB] PHP Certificate

2002-04-04 Thread Evans, Josh

Can anyone help or point me to a good tutorial for using forms to update
data in a table?


-- 
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] How to link a MYSQL table to a dbase file

2002-04-04 Thread Marij Bellen

I run my site on a linux webserver.
I don't really know what a cron is?
I can also get a csv file.
I also have a function to translate the dbase-file to sql.

Is a cron a tool or whatever to automatically load data into the database?

==
Can you use a cron (Unix) or at (Windows) job to dump the dbase data to a
 comma-separated-value table? Then suck up the csv into the mysql databasde.
 
=
> 
> How can I extract data for a mysql-table from a dbase file?
> 
> 
> This is the situation:
> 1) we have a dbase-file with data
> 2) the dbase-file is put on the server
> 3) we have a mysql-table that needs to get his data out of this
dbase-file.
> 
> How can I link this mysql-table to this file!
> 
> !!note:
> ---
> I don't mean how I can put the data of the dbase-file into the table,
> but the table should be linked to the dbase file to get its data!
> 
> Background:
> ---
> we want to upload a file with data from our own local database each night
> to our internet-mysql-database.
> 
> In MS-access such a file is called a 'external table.'
> 
> If this isn't possible and we don't have the ability to use the
> php-dbase-functions (because of our provider),
> 
> is there another solution to get the data from the dbase-file
automatically
> in the mysql-database?
> 
> Can you help me!!
> 
> Thanks.
> 
> 
> 
> -- 
> PHP Database Mailing List (
> To unsubscribe, visit: 


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




RE: [PHP-DB] How to link a MYSQL table to a dbase file

2002-04-04 Thread Rick Emery

Can you use a cron (Unix) or at (Windows) job to dump the dbase data to a
comma-separated-value table?  Then suck up the csv into the mysql databasde.


-Original Message-
From: Marij Bellen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 8:37 AM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: [PHP-DB] How to link a MYSQL table to a dbase file 


How can I extract data for a mysql-table from a dbase file?
 
 
 This is the situation:
1) we have a dbase-file with data
2) the dbase-file is put on the server
3) we have a mysql-table that needs to get his data out of this dbase-file.

 How can I link this mysql-table to this file!
 
 !!note:
 ---
 I don't mean how I can put the data of the dbase-file into the table,
 but the table should be linked to the dbase file to get its data!
 
 Background:
 ---
 we want to upload a file with data from our own local database each night
to our internet-mysql-database.
 
 In MS-access such a file is called a 'external table.'
 
If this isn't possible and we don't have the ability to use the
php-dbase-functions (because of our provider),
 
 is there another solution to get the data from the dbase-file automatically
 in the mysql-database?
 
 Can you help me!!
 
 Thanks.



-- 
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] Database Sorting by date

2002-04-04 Thread Rick Emery

Ron,

What problem are you having?  I'm looking at your code, and it's so clean, I
could eat off of it.
My only suggestion would be that $month will NEVER == "NULL".  If you are
testing for NULL, the test is:
if ($month == NULL )

Second, $month will be assigned a value, so it will never be NULL either.

BTW, what is in drop.inc?

-Original Message-
From: Ron Allen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 8:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Database Sorting by date


Here is the problem I want to be able to view all or search through the
currency lists in the database by the month.
Any help would be great!!!

Here is the code






Select a CCSD:
SELECT
VIEW ALL
March 2002
April 2002
May 2002
June 2002
July 2002
August 2002
September 2002
October 2002
November 2002
December 2002




\n";
echo "DATEEURO
EURO
RECONVERSIONKMKM
RECONVERSIONHUFKUNA\n";
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_array($result); //get a row from our result set
if($i % 2) { //this means if there is a remainder
echo "\n";
} else { //if there isn't a remainder we will do the else
echo "\n";
}
echo
"".$row['DATE']."".$row['EURO']."".$row['EURORECON']."
".$row['KM']."".$row['KMRECON']."".$row['HUF']."<
/TD>".$row['KUNA']."\n";
echo "\n";
}
//now let's close the table and be done with it
echo "\n";
?>




-- 
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 link a MYSQL table to a dbase file

2002-04-04 Thread Marij Bellen

How can I extract data for a mysql-table from a dbase file?
 
 
 This is the situation:
1) we have a dbase-file with data
2) the dbase-file is put on the server
3) we have a mysql-table that needs to get his data out of this dbase-file.

 How can I link this mysql-table to this file!
 
 !!note:
 ---
 I don't mean how I can put the data of the dbase-file into the table,
 but the table should be linked to the dbase file to get its data!
 
 Background:
 ---
 we want to upload a file with data from our own local database each night
to our internet-mysql-database.
 
 In MS-access such a file is called a 'external table.'
 
If this isn't possible and we don't have the ability to use the
php-dbase-functions (because of our provider),
 
 is there another solution to get the data from the dbase-file automatically
 in the mysql-database?
 
 Can you help me!!
 
 Thanks.



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




RE: [PHP-DB] Submitting Dynamic Form

2002-04-04 Thread Rick Emery

I use the PHP manual and the on-line resources/tutorials, such as PHP.net  I
have lots of time to read these things, because...well...I have no life

I just kind of stumble on these things.

-Original Message-
From: Chris MacKenzie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 12:51 AM
To: Rick Emery
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Submitting Dynamic Form


Ah, I just knew there must be an easy way of doing it. Thanks Rick !

Is there a good reference on stuff like this with some examples ?
Am I pushing the friendship ? :-)

Rick Emery wrote:
> 
> $HTTP_POST_VARS or $_POST is an associative array that holds the keys and
> values for all inputs/selects in  form from the submitted page.  Use
> array_keys() to determine the names of all your list boxes to examine each
> key and its value.  Or you can use the list($key,$val) =
> each($HTTP_POST_VARS) construct to extract each key and value.
> 
> So then you just walk through the array and process each entry.
> 
> -Original Message-
> From: Chris MacKenzie [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 03, 2002 8:47 AM
> To: Rick Emery
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Submitting Dynamic Form
> 
> Hi Rick,
> 
> Here's a code snippet (less error checking). Basically there could be as
> many as twnety questions listed with their associated listboxes of
> possible answers. Also be aware that ms-sql identity type is similar to
> mysqls autoincrement type except that once a record is deleted, that
> identity value is never used again.
> 
> My problem is that since the question_id field is never guaranteed to be
> sequential and seeing that I have named the answer listboxes with the
> question_id field, what is a good way to extract the values from the
> form and perform an update query ?
> 
> How can I do this if I don't know what the question_id values will be ?
> 
> -- CUT
> $sql= "SELECT * FROM tbl_exam_questions ORDER BY question_id;";
> 
> $result=mssql_query($sql,$conn1);
> $numrows = mssql_num_rows($result);
> 
> print '';
> 
> ## List All Questions and load the possible answers into list box.
> 
> for($cnt = 0; $cnt < $numrows; $cnt++){
> $row = mssql_fetch_array($result);
> print ''.$row["question_text"].'';
> print 'My Answer is:  name="'.$row["question_id"].'">- SELECT ONE
> -';
> 
> ## Now fetch the possible answers and load it into the list box.
> 
> $pa_sql = "SELECT * FROM tbl_exam_answers WHERE question_id =
> ".$row["question_id"].";";
> $pa_result = mssql_query($pa_sql,$conn1);
> 
> $pa_numrows = mssql_num_rows($pa_result);
> 
> for($pa_cnt = 0; $pa_cnt < $pa_numrows; $pa_cnt++) {
>   $pa_row = mssql_fetch_array($pa_result);
>   print ' value="'.$pa_row["id"].'">'.$pa_row["p_answers"].'';
> }
> print '';
> ## Finished Loading Possible Answers into list box.
> 
> }
> 
> print ' type="reset" value="Reset Form" name="Reset">';
> 
> -- CUT
> 
> Oh, and before I forget tbl_exam_questions.correct_answer holds the
> relevent id entry from tbl_exam_answers
> 
> > what happened when you extracted the form field names from the DB?
> >
> >> Hi All,
> >>
> >> I'm pretty new to the whole php thing and I'm currently making an
> >> multiple choice exam type of thing with php/mssql.
> >>
> >> The two tables  concerned are called tbl_exam_questions and
> >> tbl_exam_questions which are defined like so.
> >>
> >> [tbl_exam_questions] (
> >> [question_id] [int] IDENTITY (1, 1) NOT NULL ,
> >> [question_text] [varchar] (355) NOT NULL ,
> >> [correct_answer] [int] NOT NULL
> >> ) ON [PRIMARY]
> >>
> >> [tbl_exam_answers] (
> >> [id] [int] IDENTITY (1, 1) NOT NULL ,
> >> [question_id] [int] NOT NULL ,
> >> [p_answers] [varchar] (255) NOT NULL
> >> ) ON [PRIMARY]
> >>
> >> What I'm trying to do is to pull all the questions out and display them
> >> with the possible answer in a html form and dropbox.
> >> I'm displaying the entire exam on one page, with one submit button on
> >> the bottom so that the student can review the answers before finally
> >> submitting them.
> >>
> >> The problem I have is that the form field names are dynamic in that
they
> >> are set up the value held in tbl_exam_answers.question_id and with
> >> ms-sql the identity type is not guarenteed to be incremental, so how
can
> >> I reference them to send a query back to the DB to mark the student ?
> >>
> >> Have I painted myself into a corner ? :-/

--
Rgds,
Chris MacKenzie

Windows: "Where do you want to go today ?"
 Mac OS: "Where do you want to be tomorrow ?"
  Linux: "Are you coming or what ?"

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




[PHP-DB] PHP Certificate

2002-04-04 Thread Hayan Al Mamoun

Hi,
Does anyone knows a way to get PHP certificate??

Best Regards
Hayan


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




Re: [PHP-DB] Updating Forms Values

2002-04-04 Thread Paul Burney

on 4/4/02 8:35 AM, [EMAIL PROTECTED] at [EMAIL PROTECTED] appended the following
bits to my mbox:

> home.php?name=Barry Zimmerman
> 
> This once you have eddited a page becomes:
> 
> home.php?name=Barry

You'll need to url encode the variable:

echo 'home.php?name=' , urlencode($username);

HTH.

Sincerely,

Paul Burney






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




[PHP-DB] Re: Date Question

2002-04-04 Thread Ron Allen

Steve is right you can do it that way, but I would put in the area where you
insert the information into the database. Either way is correct. but I find
this way easier and you don't take up any area on your from. (preferences)

@mysql_select_db("$DBName") or die("Unable to select
database $DBName");
$logtime = date("Y-m-j G:i:s");
$sqlquery = "INSERT INTO $table
VALUES('$id','$logtime','$logccsd','$logevent','$logaction','$loginit')";

>From the PHP site:
  a.. a - "am" or "pm"

  b.. A - "AM" or "PM"

  c.. B - Swatch Internet time

  d.. d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"

  e.. D - day of the week, textual, 3 letters; i.e. "Fri"

  f.. F - month, textual, long; i.e. "January"

  g.. g - hour, 12-hour format without leading zeros; i.e. "1" to "12"

  h.. G - hour, 24-hour format without leading zeros; i.e. "0" to "23"

  i.. h - hour, 12-hour format; i.e. "01" to "12"

  j.. H - hour, 24-hour format; i.e. "00" to "23"

  k.. i - minutes; i.e. "00" to "59"

  l.. I (capital i) - "1" if Daylight Savings Time, "0" otherwise.

  m.. j - day of the month without leading zeros; i.e. "1" to "31"

  n.. l (lowercase 'L') - day of the week, textual, long; i.e. "Friday"

  o.. L - boolean for whether it is a leap year; i.e. "0" or "1"

  p.. m - month; i.e. "01" to "12"

  q.. M - month, textual, 3 letters; i.e. "Jan"

  r.. n - month without leading zeros; i.e. "1" to "12"

  s.. O - Difference to Greenwich time in hours; i.e. "+0200"

  t.. r - RFC 822 formatted date; i.e. "Thu, 21 Dec 2000 16:01:07 +0200"
(added in PHP 4.0.4)

  u.. s - seconds; i.e. "00" to "59"

  v.. S - English ordinal suffix for the day of the month, 2 characters;
i.e. "th", "nd"

  w.. t - number of days in the given month; i.e. "28" to "31"

  x.. T - Timezone setting of this machine; i.e. "MDT"

  y.. U - seconds since the epoch

  z.. w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)

  aa.. W - ISO-8601 week number of year, weeks starting on monday (added in
PHP 4.1.0) (Saturday)

  ab.. Y - year, 4 digits; i.e. "1999"

  ac.. y - year, 2 digits; i.e. "99"

  ad.. z - day of the year; i.e. "0" to "365"

  ae.. Z - timezone offset in seconds (i.e. "-43200" to "43200"). The offset
for timezones west of UTC is always negative, and for those east of UTC is
always positive.




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




[PHP-DB] Database Sorting by date

2002-04-04 Thread Ron Allen

Here is the problem I want to be able to view all or search through the
currency lists in the database by the month.
Any help would be great!!!

Here is the code






Select a CCSD:
SELECT
VIEW ALL
March 2002
April 2002
May 2002
June 2002
July 2002
August 2002
September 2002
October 2002
November 2002
December 2002




\n";
echo "DATEEURO
EURO
RECONVERSIONKMKM
RECONVERSIONHUFKUNA\n";
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_array($result); //get a row from our result set
if($i % 2) { //this means if there is a remainder
echo "\n";
} else { //if there isn't a remainder we will do the else
echo "\n";
}
echo
"".$row['DATE']."".$row['EURO']."".$row['EURORECON']."
".$row['KM']."".$row['KMRECON']."".$row['HUF']."<
/TD>".$row['KUNA']."\n";
echo "\n";
}
//now let's close the table and be done with it
echo "\n";
?>




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




[PHP-DB] Updating Forms Values

2002-04-04 Thread Bzdpltd

Hi group,

Wonder if anyone has a quick solution to this problem I am having.

I have an authentication system using cookies. The system lets a user login and then 
they are shown a list of clients which are allocated to there username. They can then 
add press releases or edit them from the links.

Now if they add a new release there are no problems and the system works fine.

The only problem I am having is when they edit an existing release it works fine they 
are taken to the updated page, and from there the links which contain there name as a 
value attached to it do not hold the full username.

For example:

home.php?name=Barry Zimmerman

This once you have eddited a page becomes:

home.php?name=Barry

So basically it is stripping the surname or anything after the space character.

Is there a way to stop this from happening.

Hope someone can help.

Many thanks


Barry Zimmerman

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