Re: [PHP-DB] ODBC problem

2001-12-13 Thread Christine Cameli

Hello,

We resolved ourselves the problem by changing the ODBC driver.
Bye.
- Original Message -
From: Christine Cameli [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Katell Galard [EMAIL PROTECTED]
Sent: Tuesday, December 11, 2001 5:03 PM
Subject: [PHP-DB] ODBC problem


Hello,

I'm accessing DBASE files (*.dbf) through the ODBC API
of a PHP 4.6.0 module.

I can select information, I can insert information
but I can not delete neither update.

Here is my code and the associated error messages :

$connect_odbc=odbc_connect($Host,,,SQL_CUR_USE_ODBC) or die(Erreur
de connexion au serveur);
if (!odbc_autocommit($connect_odbc, TRUE)) {
echo 'pb auto_commit';
return;
}
// selection avant
$Req_hebd = select * from fichhebd where NOSAL=$Nosal and
NOSEM=$Nosem and ANNEE=.substr($Annee,2,2);
echo $Req_hebd .'br';

if (!($Res_hebd=odbc_prepare($connect_odbc,$Req_hebd))) {
echo 'pb prepare';
}
if (!odbc_execute($Res_hebd)) {
echo 'pb execute';
}
if (!($res=odbc_result_all($Res_hebd))) {
echo 'pb result_all';
}
-
all is OK : the following lines appear :
  NOSAL NOSEM ANNEE IDRUBRIQUE IDCONTRAT NBMINUTE
  22.0 43.0 1.0 RD 593 1230.0
  22.0 43.0 1.0 RD 593 2.0


echo brres: . $res;
odbc_free_result($Res_hebd);

// essai sur update
$Req_hebd=UPDATE fichhebd set NBMINUTE=0 WHERE NOSAL=$Nosal and
NOSEM=$Nosem and ANNEE=.substr($Annee,2,2);
echo $Req_hebd .'br';
$Res_hebd = odbc_exec($connect_odbc,$Req_hebd);

PB : the following lines appear :
Warning: SQL error: [Microsoft][Pilote ODBC dBase] L'opération doit
utiliser une requête qui peut être mise à jour., SQL state S1000 in
SQLExecDirect in C:\Inetpub\wwwroot\CRA\Normal\valider.php on line 140
NB : 'L'opération doit utiliser une requête qui peut être mise à jour'
means 'it is not possible to make au update request'.

echo 'num_row:' . odbc_num_rows($Res_hebd) .'br';
odbc_free_result($Res_hebd);

$Req_hebd=DELETE FROM fichhebd WHERE NOSAL=$Nosal and NOSEM=$Nosem
and ANNEE=.substr($Annee,2,2);
echo $Req_hebd .'br';
$Res_hebd = odbc_exec($connect_odbc,$Req_hebd);

PB : the following lines appear :
Warning: SQL error: [Microsoft][Pilote ODBC dBase] Impossible de
supprimer dans les tables spécifiées., SQL state S1000 in SQLExecDirect
in C:\Inetpub\wwwroot\CRA\Normal\valider.php on line 146
NB : ' Impossible de supprimer dans les tables spécifiées' means 'It is
not possible to suppress in the specified tables'.


echo 'num_row:' . odbc_num_rows($Res_hebd) .'br';
odbc_free_result($Res_hebd);

// end of the php script

Thank you for helping me.

Best regards.
---
Christine CAMELI
ELIOS Informatique
Tél : 02 96 48 51 51



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: PHP and Oracle

2001-12-13 Thread Philippe Saladin

Hi Georgina,
If projectID or moduleID is a number and not a varchar, you would remove the
' enclosing the values.
WHERE projectID=$projectID   vs WHERE projectID='$projectID'

Regards,
Philippe



Georgina Elaine Bailey [EMAIL PROTECTED] a écrit dans le message news:
000801c18272$8189aa10$[EMAIL PROTECTED]
Can anybody help me! I've been getting a error message like this for the
last few days.

Warning: OCIStmtExecute: ORA-01722: invalid number on line 49
Array

Every time I try to enter a project using a HTML form

Line 49 in apparently the line that says:
$result = OCIExecute(ins_statement);

Below is the code I am trying to use:
//insert relevant values into the project table

$insert = insert into PROJECT values ('$projectID', '$moduleID', $keyID,
'$title', '$originator', '$softwareHardware', '$specialSkills', '$status',
'$externalAgreement', '$background',  '$tasks', '$steps', '$references');

 //formulate the query

$query = select projectID, moduleID, title, originator,
softwareHardware, specialSkills, status, externalAgreement,

background, tasks, steps, references from PROJECT WHERE
projectID='$projectID';





//parse the two statements

$ins_statement = OCIParse ($connection, $insert);

$qry_statement = OCIParse ($connection, $query);





//execute the first insert statement and print error message if
there is an error

$result = OCIExecute($ins_statement);



if (!$result)

{

echo OCIError($ins_statement).p;

exit;

}

  //execute the query statement

OCIExecute($qry_statement);

 //retrieve the results of the query statement and present them
in the following way

while (ocifetch($qry_statement))

{ etc.etc.




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Problem with MySQL and array loop

2001-12-13 Thread +markus lervik


Hello,

I've got a really strange problem.

When looping through a result given by mysql_fetch_row(),
the code for some reason ignores the last column in the database.

The code snippet I'm using now is


while($row=mysql_fetch_row($result)) {

print(TR);

for($i=0;$i7;$i++) {
print(TD);
if($row[$i]==) {
print(P ALIGN=\CENTER\BN/A/B/P);
}
else {
printf(P ALIGN=\CENTER\%s/P, $row[$i]);
}
print(/TD);
}
print(/TR);
}

The database has got eight columns, and I can't for the world figure
out why it doesn't work. I have exactly the same problem with another
PHP-app that I'm developing, too, so if someone has got a solution to
my problem, I'd probably get the other app working too.

What is it I'm missing, or am I just stupid?
I opt for the second choice. :)


Cheers,
Markus


-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Problem with MySQL and array loop

2001-12-13 Thread matt stewart

you're only printing stuff while i=0, i=1,i=6.
therefore only 7 things come out.
either make the loop for($i=0;$i=7;$i++), or for($i=0;$i8;$i++).

-Original Message-
From: +markus lervik [mailto:[EMAIL PROTECTED]]
Sent: 13 December 2001 09:37
To: php-db
Subject: [PHP-DB] Problem with MySQL and array loop



Hello,

I've got a really strange problem.

When looping through a result given by mysql_fetch_row(),
the code for some reason ignores the last column in the database.

The code snippet I'm using now is


while($row=mysql_fetch_row($result)) {

print(TR);

for($i=0;$i7;$i++) {
print(TD);
if($row[$i]==) {
print(P ALIGN=\CENTER\BN/A/B/P);
}
else {
printf(P ALIGN=\CENTER\%s/P, $row[$i]);
}
print(/TD);
}
print(/TR);
}

The database has got eight columns, and I can't for the world figure
out why it doesn't work. I have exactly the same problem with another
PHP-app that I'm developing, too, so if someone has got a solution to
my problem, I'd probably get the other app working too.

What is it I'm missing, or am I just stupid?
I opt for the second choice. :)


Cheers,
Markus


-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Problem with MySQL and array loop

2001-12-13 Thread +markus lervik

On Thu, 2001-12-13 at 11:42, matt stewart wrote:

 you're only printing stuff while i=0, i=1,i=6.
 therefore only 7 things come out.
 either make the loop for($i=0;$i=7;$i++), or for($i=0;$i8;$i++).

Oh! Thanks a million! It works like a charm now.
So I guess the second alternative was right, after all.

Isn't it funny, how one can become code-blind regarding one
own's code?

-Markus 

-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] memory leak???

2001-12-13 Thread Sommai Fongnamthip

Hi,

I have an error when try to query from 2 database (m$ sql).

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to 
allocate 29 bytes)

when I check my server memory it have free for a lot
  total   used   free sharedbuffers cached
Mem:126516 110996  15520  38864  38212  42192
-/+ buffers/cache:  30592  95924
Swap:96348   4848  91500

How could I fixed this problem??

SF



[PHP-DB] ODBC .. ehm .. help :)

2001-12-13 Thread b i k k e l

Hi,

i get the following error with the code listed below: Fatal error: Call to
undefined function: odbc_connect() in
/home/users/sites/www.nlhq.nl/html/connect.php3 on line 2

?PHP
  $db = odbc_connect('server4.1a.nl', '', '', SQL_CUR_USE_ODBC);
?

This is the URL of the PHP script: http://www.nlhq.nl/connect.php3

Tought it might my usefull to give ya all the info i can get .. so ..
http://www.nlhq.nl/info.php

Hope some1 can help me out here ..
Thanx!



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Dumb Question??

2001-12-13 Thread Russ Michell

Hi there everyone:

I have a genericphp/MySQL search+retrival mechanism. Generic in that it takes table 
names, 
fieldnames and fieldtypes as form lables and element names. However, because of this I 
cannot 
hard-code my SQL queries as they need to be as generic (univerally useful) as possible.

I therefore have a lot of SELECT * FROM table_name... queries. However I would 
like to be able 
to specify a particular column ('modified') to appear under specific circumstances, 
somewhere along 
the lines of: SELECT *,!modified FROM table_name .. I scanned TFM and couldn't 
find anything 
specific to my problem. I have an incling this may not be as easy as I think, so does 
anyone know 
of a bodge,kludge or workaround??

Thanks for your time.
Russ

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Dumb Question??

2001-12-13 Thread Russ Michell

Sorry! just read-read my post, it should have been:

particular column ('modified') *NOT* to appear under specific circumstances, 
somewhere along...

Cheers.
Russ

On Thu, 13 Dec 2001 12:03:09 + (GMT Standard Time) Russ Michell 
[EMAIL PROTECTED] wrote:

 Hi there everyone:
 
 I have a genericphp/MySQL search+retrival mechanism. Generic in that it takes table 
names, 
 fieldnames and fieldtypes as form lables and element names. However, because of this 
I cannot 
 hard-code my SQL queries as they need to be as generic (univerally useful) as 
possible.
 
 I therefore have a lot of SELECT * FROM table_name... queries. However I would 
like to be able 
 to specify a particular column ('modified') to appear under specific circumstances, 
somewhere along 
 the lines of: SELECT *,!modified FROM table_name .. I scanned TFM and couldn't 
find anything 
 specific to my problem. I have an incling this may not be as easy as I think, so 
does anyone know 
 of a bodge,kludge or workaround??
 
 Thanks for your time.
 Russ
 
 #---#
   
   Believe nothing - consider everything 
   
   Russ Michell
   Anglia Polytechnic University Webteam
   Room 1C 'The Eastings' East Road, Cambridge
   
   e: [EMAIL PROTECTED]
   w: www.apu.ac.uk/webteam
 
   www.theruss.com
   
 #---#
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: memory leak???

2001-12-13 Thread Yasuo Ohgaki

Sommai Fongnamthip wrote:

 Hi,
 
 I have an error when try to query from 2 database (m$ sql).
 
 Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to 
 allocate 29 bytes)


You have exhausted allow memory for PHP to use.
Increase your memory limit.
(Read php.ini-dist or php.ini-recommened)

-- 
Yasuo Ohgaki


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Help me with php script calculate Download time of file

2001-12-13 Thread chidambaram

Hi everyone,
Could anyone help me giving a php code that
calculates time required to download a url
(including downloading of images in that particular url).
if you could tell me the site also it would be great helpful
to you people.

Thank You
E.chidmbaram


For Stock Quotes, Finance News, Insurance, Tax Planners, Mutual Funds...
Visit http://in.finance.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] ODBC .. ehm .. help :)

2001-12-13 Thread Andrew Hill

Bikkel,

Is ODBC enabled on your sever?
If this is a *nix server, follow the Howto at www.iodbc.org.  If windows,
check your odbc.ini for the proper setting.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers

 -Original Message-
 From: b i k k e l [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 4:35 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] ODBC .. ehm .. help :)


 Hi,

 i get the following error with the code listed below: Fatal
 error: Call to
 undefined function: odbc_connect() in
 /home/users/sites/www.nlhq.nl/html/connect.php3 on line 2

 ?PHP
   $db = odbc_connect('server4.1a.nl', '', '', SQL_CUR_USE_ODBC);
 ?

 This is the URL of the PHP script: http://www.nlhq.nl/connect.php3

 Tought it might my usefull to give ya all the info i can get .. so ..
 http://www.nlhq.nl/info.php

 Hope some1 can help me out here ..
 Thanx!



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Data - countinents, countries, provinces, cities 10.000

2001-12-13 Thread Dasmeet Singh Arora

Why not try searching at www.google.com ?

Andy wrote:

Hi there,

I am building a travel portal and I can't get data for the registration.

Does anybody have, or know where I can get this data from?

I am searching for the continents belonging to the countries, belonging to
the provinces belonging to the cities over 1.

Thanx for any help.

cheers Andy




-- 
http://www.fedoXpress.com
Looking for a new email address?
http://www.fedoXpress.com





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Connecting to MySQL Database

2001-12-13 Thread Jonathan Hilgeman

Can you show us the code that checks the username and password to see if
they're correct?

Is this a custom admin page that you created? 

If your page is authenticating against the mysql database, then you should
know that MySQL encrypts the password and stores  the encrypted password.

So if you use the GRANT statement to create a new user that looks like:
User: admin
Pass: Secrets

...MySQL will store this as:
User: admin
Pass: Ata91230t!44

So if you try to login and your login code looks like:
if($PasswordEntered == $DatabasePassword)
{
...
}

So even if $PasswordEntered equals Secrets, it won't be the same, because
it won't match the encrypted password.

- Jonathan

-Original Message-
From: Michael Elliott [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 5:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Connecting to MySQL Database


I am trying to create an admin page to administer my database.  I used a
file .sql to create my database.  In the file, I included:

grant select, insert, update, delete
on database.*
to admin@localhost identified by 'password';

Why can I not log in successfully using admin and password?

Thanks




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Connecting to MySQL Database

2001-12-13 Thread Michael Elliott

Alright here goes.

This is my login function:

function login($username, $password)
// check username and password with db
// if yes, return true
// else return false

{
 // connect to db
 $conn = db_connect();
 if (!$conn)
  return 0;

 // check if username is unique
 $result = mysql_query(select * from admin
  where username='username' and
  password = password('$password'));

 if (!$result)
  return 0;

 if (mysql_num_rows($result)0)
  return 1;
 else
  return 0;
}

And here is my admin.php page:

?

// include function files for this application
require_once(golf_fns.php);
session_start();

if ($username  $passwd)
// they have just tried logging in
{
 if (login($username, $passwd))
 {
  // if they are in the database register the user id
  $admin_user = $username;
  session_register(admin_user);
 }
 else
 {
  // unsuccessful login
  do_html_header(Problem:);
  echo You could not be logged in.
  You must be logged in to view this page. br;
  do_html_url(login.php, Login);
  do_html_footer();
  exit;
 }
}

do_html_header(Administration);
if (check_admin_user())
 display_admin_menu();
else
 echo You are not authorized to enter the administration area.;

do_html_footer();

?

I checked my database and as you said, the password has been encrypted.
Shouldn't MySQL be able to compare it against an encrypted password?

Thanks for your help!


Jonathan Hilgeman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Can you show us the code that checks the username and password to see if
 they're correct?

 Is this a custom admin page that you created?

 If your page is authenticating against the mysql database, then you
should
 know that MySQL encrypts the password and stores  the encrypted password.

 So if you use the GRANT statement to create a new user that looks like:
 User: admin
 Pass: Secrets

 ...MySQL will store this as:
 User: admin
 Pass: Ata91230t!44

 So if you try to login and your login code looks like:
 if($PasswordEntered == $DatabasePassword)
 {
 ...
 }

 So even if $PasswordEntered equals Secrets, it won't be the same,
because
 it won't match the encrypted password.

 - Jonathan

 -Original Message-
 From: Michael Elliott [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 5:54 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Connecting to MySQL Database


 I am trying to create an admin page to administer my database.  I used a
 file .sql to create my database.  In the file, I included:

 grant select, insert, update, delete
 on database.*
 to admin@localhost identified by 'password';

 Why can I not log in successfully using admin and password?

 Thanks




 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Connecting to MySQL Database

2001-12-13 Thread Jonathan Hilgeman

Try moving session_start to the very top of the script (above the require
statement), and then place the session_register on the line immediately
below session_start. You should first create the empty session variable
$admin_user, and THEN assign a value to it. But the most logical thing to do
would be to put all the session information at the very top of the script.

- Jonathan

-Original Message-
From: Michael Elliott [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 8:40 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Connecting to MySQL Database


Alright here goes.

This is my login function:

function login($username, $password)
// check username and password with db
// if yes, return true
// else return false

{
 // connect to db
 $conn = db_connect();
 if (!$conn)
  return 0;

 // check if username is unique
 $result = mysql_query(select * from admin
  where username='username' and
  password = password('$password'));

 if (!$result)
  return 0;

 if (mysql_num_rows($result)0)
  return 1;
 else
  return 0;
}

And here is my admin.php page:

?

// include function files for this application
require_once(golf_fns.php);
session_start();

if ($username  $passwd)
// they have just tried logging in
{
 if (login($username, $passwd))
 {
  // if they are in the database register the user id
  $admin_user = $username;
  session_register(admin_user);
 }
 else
 {
  // unsuccessful login
  do_html_header(Problem:);
  echo You could not be logged in.
  You must be logged in to view this page. br;
  do_html_url(login.php, Login);
  do_html_footer();
  exit;
 }
}

do_html_header(Administration);
if (check_admin_user())
 display_admin_menu();
else
 echo You are not authorized to enter the administration area.;

do_html_footer();

?

I checked my database and as you said, the password has been encrypted.
Shouldn't MySQL be able to compare it against an encrypted password?

Thanks for your help!


Jonathan Hilgeman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Can you show us the code that checks the username and password to see if
 they're correct?

 Is this a custom admin page that you created?

 If your page is authenticating against the mysql database, then you
should
 know that MySQL encrypts the password and stores  the encrypted password.

 So if you use the GRANT statement to create a new user that looks like:
 User: admin
 Pass: Secrets

 ...MySQL will store this as:
 User: admin
 Pass: Ata91230t!44

 So if you try to login and your login code looks like:
 if($PasswordEntered == $DatabasePassword)
 {
 ...
 }

 So even if $PasswordEntered equals Secrets, it won't be the same,
because
 it won't match the encrypted password.

 - Jonathan

 -Original Message-
 From: Michael Elliott [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 5:54 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Connecting to MySQL Database


 I am trying to create an admin page to administer my database.  I used a
 file .sql to create my database.  In the file, I included:

 grant select, insert, update, delete
 on database.*
 to admin@localhost identified by 'password';

 Why can I not log in successfully using admin and password?

 Thanks




 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] ODBC .. ehm .. help :)

2001-12-13 Thread Andrew Hill

If you followed the howto and you are still receiving an undefined
function error, than you might have more than one apache/php instance, and
you are starting the wrong one :)

What was the configure command you used?  Did you use a --prefix?  If so,
that is the one you need to start.

Also, check the output of your phpinfo(); to verify ODBC is enabled - the
link you gave to info.php is 'forbidden'.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers

 -Original Message-
 From: b i k k e l [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 11:24 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] ODBC .. ehm .. help :)


 Yes, i follows all the steps described at www.iodbc.org. Still no
 result :(

 --
 Original Message
 From: Andrew Hill[EMAIL PROTECTED]
 Subject: RE: [PHP-DB] ODBC .. ehm .. help :)
 Date: Thu, 13 Dec 2001 09:32:25 -0500

 Bikkel,
 
 Is ODBC enabled on your sever?
 If this is a *nix server, follow the Howto at www.iodbc.org.  If windows,
 check your odbc.ini for the proper setting.
 
 Best regards,
 Andrew Hill
 Director of Technology Evangelism
 OpenLink Software  http://www.openlinksw.com
 Universal Data Access  Data Integration Technology Providers
 
  -Original Message-
  From: b i k k e l [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, December 13, 2001 4:35 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] ODBC .. ehm .. help :)
 
 
  Hi,
 
  i get the following error with the code listed below: Fatal
  error: Call to
  undefined function: odbc_connect() in
  /home/users/sites/www.nlhq.nl/html/connect.php3 on line 2
 
  ?PHP
$db = odbc_connect('server4.1a.nl', '', '', SQL_CUR_USE_ODBC);
  ?
 
  This is the URL of the PHP script: http://www.nlhq.nl/connect.php3
 
  Tought it might my usefull to give ya all the info i can get .. so ..
  http://www.nlhq.nl/info.php
 
  Hope some1 can help me out here ..
  Thanx!
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 
 
 
 
 
 

 _
 Free email with personality! Over 200 domains!
 http://www.MyOwnEmail.com






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] quetion about Win PHP mssql

2001-12-13 Thread Shane Peery

I have php setup on the following platform:

Web Server: Win2k IIS
DB Server: MSSQL 2000

I'm having a problem when running a view that acesses a user defined
function.  The function outputs a converted date to varchar + a varchar
string.  The problem is that when I loop through the recordset I get strange
results.  The data currently has one field from the view with data and a
null.  

The code I use to retreive the values is this:


$sql = Select LastPost From vwSubTopicDetails;

$result = mssql_query($sql);

while ($rs = mssql_fetch_array($result)) {
echo $rs[LastPost] . brbr;
}

The data that gets echo'd back is this:

12/05/2001 shane

12/05/2001 


Can anyone tell me why I'm getting the phantom date in the second row of the
recordset?  This seems to be PHP specific, as I've tried running the query
in query analyser and in an ASP page without incident.

Thanks in advance,

Shane Peery

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PHP and dBase file support?

2001-12-13 Thread jward

Is the dBase file format supported on both ApacheWindows and Apache *NIX
versions of PHP?

I see to enable dBase support, the --enable-dbase option has to be
included in the
configure command.

I need to know if this command is supported in the Apache/PHP *NIX
environment,
or is it only supported in the Windows environment.

John


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: parse error

2001-12-13 Thread Matthew Crouch

you haven't shut your script with the ? before starting your HTML, near as I
can figure it

Rob Day wrote:

 I've written a small script that processes a form from a webpage and sends
 the submitted data as an HTML e-mail that has the form all filled out
 already. I've gotten smaller versions of this script to work without any
 problem just to test the idea.I can't figure out why I'm now getting the
 following error:
 Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3
 on line 358

 Here is the offending code:
 353 if ($moderation == no){
 354 $message .=  checked;
 355 }
 356
 357$message .= '
 358nobr
 359pAnswer yes if you want all postings to the list to be
 sent to
 360  a moderator for approval before distribution to the
 list./p

 Any help would be greatly appreciated. Thanks!
 
 Rob Day
 Web Team Leader
 Texas State Library and Archives Commission
 phone: 512.936.4463   fax: 512.463.5436
 [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Re: parse error

2001-12-13 Thread Rob Day

Sorry for not giving enough info. This is right in the middle of the script.
I do have the opening and closing tags. It must ne something else.

-Original Message-
From: Matthew Crouch [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 4:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: parse error


you haven't shut your script with the ? before starting your HTML, near as
I
can figure it

Rob Day wrote:

 I've written a small script that processes a form from a webpage and sends
 the submitted data as an HTML e-mail that has the form all filled out
 already. I've gotten smaller versions of this script to work without any
 problem just to test the idea.I can't figure out why I'm now getting the
 following error:
 Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3
 on line 358

 Here is the offending code:
 353 if ($moderation == no){
 354 $message .=  checked;
 355 }
 356
 357$message .= '
 358nobr
 359pAnswer yes if you want all postings to the list to be
 sent to
 360  a moderator for approval before distribution to the
 list./p

 Any help would be greatly appreciated. Thanks!
 
 Rob Day
 Web Team Leader
 Texas State Library and Archives Commission
 phone: 512.936.4463   fax: 512.463.5436
 [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Re: parse error

2001-12-13 Thread Nally, Tyler G.

Not sure but if line 358 is...

   358nobr

.. as it says below, then the  before the no needs 
a beginnnig to it somehow.  It's like a html-tag that's
only half baked.

--
__   _Tyler Nally
   / /__   _(_)___       _ _  [EMAIL PROTECTED]
  / / _ \/ __ `/ / __ \/ __ \ / __ \/ ___/ __ `/  317-860-3016
 / /  __/ /_/ / / /_/ / / / // /_/ / /  / /_/ /   American Legion Website
/_/\___/\__, /_/\/_/ /_(_)/_/   \__, /http://www.legion.org
   //  //   

 -Original Message-
 From: Rob Day [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 5:37 PM
 To: '[EMAIL PROTECTED]'
 Subject: RE: [PHP-DB] Re: parse error
 
 
 Sorry for not giving enough info. This is right in the middle 
 of the script.
 I do have the opening and closing tags. It must ne something else.
 
 -Original Message-
 From: Matthew Crouch [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 4:04 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: parse error
 
 
 you haven't shut your script with the ? before starting your 
 HTML, near as
 I
 can figure it
 
 Rob Day wrote:
 
  I've written a small script that processes a form from a 
 webpage and sends
  the submitted data as an HTML e-mail that has the form all 
 filled out
  already. I've gotten smaller versions of this script to 
 work without any
  problem just to test the idea.I can't figure out why I'm 
 now getting the
  following error:
  Parse error: parse error in 
 /home/httpd/cgi-bin/rday/lists/do_listapp.php3
  on line 358
 
  Here is the offending code:
  353 if ($moderation == no){
  354 $message .=  checked;
  355 }
  356
  357$message .= '
  358nobr
  359pAnswer yes if you want all postings to 
 the list to be
  sent to
  360  a moderator for approval before distribution to the
  list./p
 
  Any help would be greatly appreciated. Thanks!
  
  Rob Day
  Web Team Leader
  Texas State Library and Archives Commission
  phone: 512.936.4463   fax: 512.463.5436
  [EMAIL PROTECTED]
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: parse error

2001-12-13 Thread Matthew Crouch

your line 357 doesn't appear to have its semicolon...

Rob Day wrote:

 Sorry for not giving enough info. This is right in the middle of the script.
 I do have the opening and closing tags. It must ne something else.

 -Original Message-
 From: Matthew Crouch [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 4:04 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: parse error

 you haven't shut your script with the ? before starting your HTML, near as
 I
 can figure it

 Rob Day wrote:

  I've written a small script that processes a form from a webpage and sends
  the submitted data as an HTML e-mail that has the form all filled out
  already. I've gotten smaller versions of this script to work without any
  problem just to test the idea.I can't figure out why I'm now getting the
  following error:
  Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3
  on line 358
 
  Here is the offending code:
  353 if ($moderation == no){
  354 $message .=  checked;
  355 }
  356
  357$message .= '
  358nobr
  359pAnswer yes if you want all postings to the list to be
  sent to
  360  a moderator for approval before distribution to the
  list./p
 
  Any help would be greatly appreciated. Thanks!
  
  Rob Day
  Web Team Leader
  Texas State Library and Archives Commission
  phone: 512.936.4463   fax: 512.463.5436
  [EMAIL PROTECTED]

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Dynamically populating a dropdown box

2001-12-13 Thread Chris Payne

Hi there everyone,

I have a shopping cart which is starting to work nicely, but I have to select 
size/color from the entries, how do I do this dynamically in PHP with MySQL?  I need 
them to be dropdown form boxes but haven't got a clue how to populate them from the 
fields of my database.

Please help me with example code if possible, it would be greatly appreciated :-)

Thank you everyone

Regards

Chris



[PHP-DB] Re: Dynamically populating a dropdown box

2001-12-13 Thread Matthew Crouch

I'm no expert, and my code is probably buggy, but I think this is the gist of it:

select name=color
?
$result = mysql_query(SELECT * from colors);
while ($myrow = mysql_fetch_array($result)) {
printf(option value=%s%s/option, $myrow[colorid], $myrow[colorname]);
}
?
/select


Chris Payne wrote:

 Hi there everyone,

 I have a shopping cart which is starting to work nicely, but I have to select 
size/color from the entries, how do I do this dynamically in PHP with MySQL?  I need 
them to be dropdown form boxes but haven't got a clue how to populate them from the 
fields of my database.

 Please help me with example code if possible, it would be greatly appreciated :-)

 Thank you everyone

 Regards

 Chris


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: Dynamically populating a dropdown box

2001-12-13 Thread ST Ooi

or alternatively, you can download a drop down box populating class from

http://phpclasses.upperdesign.com/


- Original Message -
From: Matthew Crouch [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 14, 2001 6:57 AM
Subject: [PHP-DB] Re: Dynamically populating a dropdown box


 I'm no expert, and my code is probably buggy, but I think this is the gist
of it:

 select name=color
 ?
 $result = mysql_query(SELECT * from colors);
 while ($myrow = mysql_fetch_array($result)) {
 printf(option value=%s%s/option, $myrow[colorid],
$myrow[colorname]);
 }
 ?
 /select


 Chris Payne wrote:

  Hi there everyone,
 
  I have a shopping cart which is starting to work nicely, but I have to
select size/color from the entries, how do I do this dynamically in PHP with
MySQL?  I need them to be dropdown form boxes but haven't got a clue how to
populate them from the field
 s of my database.
 
  Please help me with example code if possible, it would be greatly
appreciated :-)
 
  Thank you everyone
 
  Regards
 
  Chris


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: PHP and dBase file support?

2001-12-13 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:

 Is the dBase file format supported on both ApacheWindows and Apache *NIX
 versions of PHP?
 
 I see to enable dBase support, the --enable-dbase option has to be
 included in the
 configure command.
 
 I need to know if this command is supported in the Apache/PHP *NIX
 environment,
 or is it only supported in the Windows environment.
 


Could you report your problem as Documentation problem?
(ie submit bug report.)
Make sure you read manual pages including user notes
*before* create bug report. If it is written, no need to report
this.

BTW, it seems dbase extesion does not require any external lib.
You should be able to use it under UNIX, if it is working :)

Use of dbase for production system is not recommended as
described in the manual.

-- 
Yasuo Ohgaki


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] parse error

2001-12-13 Thread Daniel Barton

Rob -

I think I see what you're doing: you're concatenating $message with something
else (the HTML output following line 357?). Problem is, you're just stating
the right hand side of what should be an assignment. The concatenation should
be:

$variable = $variable .= 'HTML output';

and it looks like you just have

$variable .= 'HTML output';

although you didn't post enough code for me to be sure of this.

If you didn't mean to concatenate something, trying taking the dot before the
equal sign out of the statement.

If I'm completely wrong as to what you're trying to do, apologies.

cheers,
db

Rob Day wrote:

 I've written a small script that processes a form from a webpage and sends
 the submitted data as an HTML e-mail that has the form all filled out
 already. I've gotten smaller versions of this script to work without any
 problem just to test the idea.I can't figure out why I'm now getting the
 following error:
 Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3
 on line 358

 Here is the offending code:
 353 if ($moderation == no){
 354 $message .=  checked;
 355 }
 356
 357$message .= '
 358nobr
 359pAnswer yes if you want all postings to the list to be
 sent to
 360  a moderator for approval before distribution to the
 list./p

 Any help would be greatly appreciated. Thanks!
 
 Rob Day
 Web Team Leader
 Texas State Library and Archives Commission
 phone: 512.936.4463   fax: 512.463.5436
 [EMAIL PROTECTED]

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
--
Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
[EMAIL PROTECTED]
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]