Re: [PHP-DB] pictures into MySQL

2002-12-17 Thread Jason Wong
On Tuesday 17 December 2002 04:27, Seabird wrote:
 Hi everyone,

 I know that inserting actual pictures into a MySQL DB is not the best
 solution, but since I know the size is going to be limited I want to do it
 anyways. How do I upload a picture into a DB? (what type of table etc.).

google  php insert picture into mysql

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
It's not an optical illusion, it just looks like one.
-- Phil White
*/


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




Re: [PHP-DB] login won't log in, HELP

2002-12-17 Thread Jason Wong
On Tuesday 17 December 2002 14:42, David wrote:
 Hello,

 I am pretty new to PHP and I am trying to create a admin login page so my
 client can view thier product line and orders.  I have MySQL set-up
 properly and have data in it and I am able to view information from the db
 with no problem. I do all my testing on my local machine before I blast it
 to the main web server.  I am using 2000XP Pro, Apache/1.3.23 (Win32) and
 PHP Ver. 4.2.3.  The main webserver is a Unix system.

 The problem I am having is I created a login.php and a include page called
 admin.inc.php.  I tried to log-in but the login.php reloads and the login
 fields are blank. It should go to the admin.php or give me some type of
 error.  I get no errors message.  I was getting errors earlier but I forgot
 to put a ; on one line.

If you've set error reporting to maximum (error_reporting  =  E_ALL) and 
you're still not getting any errors then it must be some faulty logic in your 
code.

 I going to copy my login.php and admin.inc.php code hoping that someone
 could help my and point out what am I over looking.  I put a #pound sign in
 front of the code, I hope this is ok.

Rather than debug your code for you, here are a couple of pointers:

1) Bypass the login page, hardcode the login details and see whether that gets 
you logged in.

2) Use print_r() on your major variables in strategic places in your code to 
see what's happening to them as they pass through your code.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Wish not to seem, but to be, the best.
-- Aeschylus
*/


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




RE: [PHP-DB] How can I use PHP to duplicate a mysql template database? [hack]

2002-12-17 Thread Daevid Vincent
Seems to me there should be a built in SQL or PHP command to duplicate a
database. Jeepers. Or to read in a .sql file from PHP and create a
database out of it (which was the original intent).

Anyways, here's a 'hack'. I'd still love to hear anyone else's more
elegant solution.

$V2DB = V2_SL.$CompanyID;

$result = mysql_create_db($V2DB, $linkI);
if (!$result) $errorstring .= Error creating .$V2DB.
databaseBR\n.mysql_errno($linkI).: .mysql_error($linkI).BR\n; 

mysql_select_db ($V2DB, $linkI) or die (Could not select .$V2DB.
Database);
/*
//TODO: None of these below here work. Ugh! so frustrating!!
//$filename = /mypath/todb/V2_DB.sql;
//$fd = fopen ($filename, r);
//$sql = fread ($fd, filesize ($filename));
//fclose ($fd);

//$lines = file($filename);
//foreach ($lines as $line_num = $line) { $sql .= $line; }

//$sqlTables = explode(;,$sql);
//foreach ($sqlTables as $table)
//{
//  echo PRE$table/PREphr\n;
//  $result = mysql_query($sql,$linkI);
//  if (!$result) $errorstring .= Error creating .$V2DB.
.$table. tableBR\n.mysql_errno($linkI).:
.mysql_error($linkI).BR\n; 
//}
*/

//You must have already created the V2_Template database. 
//This will make a clone of it, including data, so most likely leave it
empty

$tableResult = mysql_list_tables (V2_Template);
while ($row = mysql_fetch_row($tableResult)) 
{
$tsql = CREATE TABLE .$V2DB...$row[0]. AS SELECT * FROM
V2_Template..$row[0];
echo $tsql.BR\n;
$tresult = mysql_query($tsql,$linkI);
if (!$tresult) $errorstring .= Error creating
.$V2DB...$row[0]. tableBR\n.mysql_errno($linkI).:
.mysql_error($linkI).BR\n; 
}


 -Original Message-
 From: Daevid Vincent [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, December 16, 2002 8:00 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] How can I use PHP to duplicate a mysql 
 template database?
 
 
 I need to use PHP to duplicate the schema of a database. This 
 seems like
 it should be a simple task -- taking a 'template' db and 
 cloning it with
 a new name. 
 
 I've tried things like:
 
   $filename = myDB.sql;
   $fd = fopen ($filename, r);
   $sql = fread ($fd, filesize ($filename));
   fclose ($fd);
 
 And 
 
   $lines = file($filename);
   foreach ($lines as $line_num = $line) { $sql .= $line;
 }
 
 And
   $sql .= CREATE TABLE IP_Dept (;
   $sql .=   IP_Addr int(10) unsigned NOT NULL default
 '0',;
   $sql .=   DeptID int(10) unsigned NOT NULL default
 '0';
   $sql .= );;
   
   $sql .= CREATE TABLE ResolveTable (;
   $sql .=   IP_Addr int(10) unsigned NOT NULL default
 '0',;
   $sql .=   Name char(255) NOT NULL default '',;
   $sql .=   Custom char(1) default NULL,;
   $sql .=   Global char(1) default 'Y',;
   $sql .=   OSVersion char(255) default NULL,;
   $sql .=   RowID int(10) unsigned NOT NULL
 auto_increment,;
   $sql .=   Display enum('Yes','No') NOT NULL default
 'Yes',;
   $sql .=   PRIMARY KEY  (RowID);
   $sql .= );;
   
   echo PRE.$sql./PREP;
   $result = mysql_query($sql,$linkI);
 
 But ALL of them fail! Ugh!!! Can I not stack commands like that? Is
 there some way to read in a .sql file via PHP?  The problem is that my
 web pages are on a web server and the db is on a mysql server 
 which are
 different machines, so calling a system() or other execute style
 function won't work for me.
 
 I figured, Ah! Why don't I just make a template db on the server and
 issue some SQL command to 'clone' that and rename it. You'd 
 think that
 was pretty straight forward, but I can't find any examples or commands
 to do this seemingly trivial task. Ideas?
 
 
 -- 
 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] random select

2002-12-17 Thread Bruce Levick
Bruce Levick - VivamotionI was curious as to what is the best way to select
a random row from a table in my database.

I have currently five rows and will be expanding on that as well. I have
tried this code.


//retrieve random row
?php
 $rndm = mysql_query(SELECT * FROM Illustrations ORDER BY RAND() LIMIT 1);
 if (!$rndm) {
  echo(PError performing query:  .
   mysql_error() . /P);
  exit();
}
 ?

##
output random row

?php
 print b$rndm[titletext]/b\n;
 ?

##

 but am not getting anything when output with PHP in a browser. I am working
off localhost on a WINXP machine. PHP 4.2.2.

Cheers









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




[PHP-DB] Getting database output into another frame in another window

2002-12-17 Thread Chris Jewell
Hi,

I've got a set up where I would like my query output to appear in a frame in a 
main window.  Since my queries require stepwise user input, they are going to 
be built up in a pop-up window.  When the query form (in the popup) is sent, 
it calls a php script which drags the data out of a Postgresql database.  
However, I then want the query results to be sent to the frame in the main 
(parent with respect to the pop-up) window.  How do I acheive this?  Things I 
have tried are:

1. Putting FORM ACTION=opener.location.replace('query.php') METHOD=GET

2. Naming the main window with BODY onLoad=window.name='maindb' then 
putting FORM ACTION=query.php TARGET=maindb.queryframe METHOD=GET

Number (1) opens query.php in the correct location (ie the frame in the main 
page) but does not pass the form data to the server.  Number (2) passes the 
form data to the server, but the results appear in a new window.  ARGH!

Any ideas?

Chris J

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




Re: [PHP-DB] Getting database output into another frame in another window

2002-12-17 Thread Chris Jewell
The name specified in (2) is maindb.queryframe.  I have a frame defined as 
FRAME NAME=queryframe in the maindb window.  Still not working :(

On Tuesday 17 December 2002 11:04, you wrote:
 At 10:59 17-12-02 +, you wrote:
 Hi,
 
 I've got a set up where I would like my query output to appear in a frame
 in a
 main window.  Since my queries require stepwise user input, they are going
  to be built up in a pop-up window.  When the query form (in the popup) is
  sent, it calls a php script which drags the data out of a Postgresql
  database. However, I then want the query results to be sent to the frame
  in the main (parent with respect to the pop-up) window.  How do I acheive
  this?  Things I have tried are:
 
 1. Putting FORM ACTION=opener.location.replace('query.php')
  METHOD=GET
 
 2. Naming the main window with BODY onLoad=window.name='maindb' then
 putting FORM ACTION=query.php TARGET=maindb.queryframe METHOD=GET
 
 Number (1) opens query.php in the correct location (ie the frame in the
  main page) but does not pass the form data to the server.  Number (2)
  passes the form data to the server, but the results appear in a new
  window.  ARGH!
 
 Any ideas?

 For number 2 the name has to match the name you defined in the frame tag
 (if you use frames)

 Chris J
 
 --
 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] Getting database output into another frame in another window

2002-12-17 Thread Wico de Leeuw
At 11:06 17-12-02 +, Chris Jewell wrote:

The name specified in (2) is maindb.queryframe.  I have a frame defined as
FRAME NAME=queryframe in the maindb window.  Still not working :(


The names has to match, so either you specify target=queryframe in the 
form or do
FRAME NAME=maindb.queryframe

Gr,

Wico

On Tuesday 17 December 2002 11:04, you wrote:
 At 10:59 17-12-02 +, you wrote:
 Hi,
 
 I've got a set up where I would like my query output to appear in a frame
 in a
 main window.  Since my queries require stepwise user input, they are going
  to be built up in a pop-up window.  When the query form (in the popup) is
  sent, it calls a php script which drags the data out of a Postgresql
  database. However, I then want the query results to be sent to the frame
  in the main (parent with respect to the pop-up) window.  How do I acheive
  this?  Things I have tried are:
 
 1. Putting FORM ACTION=opener.location.replace('query.php')
  METHOD=GET
 
 2. Naming the main window with BODY onLoad=window.name='maindb' then
 putting FORM ACTION=query.php TARGET=maindb.queryframe METHOD=GET
 
 Number (1) opens query.php in the correct location (ie the frame in the
  main page) but does not pass the form data to the server.  Number (2)
  passes the form data to the server, but the results appear in a new
  window.  ARGH!
 
 Any ideas?

 For number 2 the name has to match the name you defined in the frame tag
 (if you use frames)

 Chris J
 
 --
 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




Re: [PHP-DB] Getting database output into another frame in another window

2002-12-17 Thread Chris Jewell
New development!  It seems that if I just specify FORM ACTION=query.php 
TARGET=maindb METHOD=GET that the results go into the main window - just 
not into the frame.  So the main problem is now persuading browser to put the 
output into the frame instead of the whole window.

Chris

On Tuesday 17 December 2002 10:59, Chris Jewell wrote:
 Hi,

 I've got a set up where I would like my query output to appear in a frame
 in a main window.  Since my queries require stepwise user input, they are
 going to be built up in a pop-up window.  When the query form (in the
 popup) is sent, it calls a php script which drags the data out of a
 Postgresql database. However, I then want the query results to be sent to
 the frame in the main (parent with respect to the pop-up) window.  How do I
 acheive this?  Things I have tried are:

 1. Putting FORM ACTION=opener.location.replace('query.php')
 METHOD=GET

 2. Naming the main window with BODY onLoad=window.name='maindb' then
 putting FORM ACTION=query.php TARGET=maindb.queryframe METHOD=GET

 Number (1) opens query.php in the correct location (ie the frame in the
 main page) but does not pass the form data to the server.  Number (2)
 passes the form data to the server, but the results appear in a new window.
  ARGH!

 Any ideas?

 Chris J


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




Re: [PHP-DB] random select

2002-12-17 Thread Jason Wong
On Tuesday 17 December 2002 18:46, Bruce Levick wrote:
 Bruce Levick - VivamotionI was curious as to what is the best way to select
 a random row from a table in my database.

 I have currently five rows and will be expanding on that as well. I have
 tried this code.

 
 //retrieve random row
 ?php
  $rndm = mysql_query(SELECT * FROM Illustrations ORDER BY RAND() LIMIT

You need to use one of the mysql_fetch_*() functions. Details and examples in 
manual.

  but am not getting anything when output with PHP in a browser. I am
 working off localhost on a WINXP machine. PHP 4.2.2.


-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Ain't that something what happened today.  One of us got traded to
Kansas City.
-- Casey Stengel, informing outfielder Bob Cerv he'd
   been traded.
*/


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




[PHP-DB] Oracle/PHP question...

2002-12-17 Thread Anthony Carlos
Yes, you need to recompile PHP: ./configure --with-oci8=[your_oracle_home]

-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 1:58 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] Oracle/PHP question...


I am now trying to setup connectivity to a remote Oracle database
for my PHP/Apache web server.  I am attempting to verify connectivity to the
database by:

?php
$connection = OCILogon(user, password) or die (Unable to logon to
database.);
?

I have installed the Oracle client on the system, and I have also
setup the ORACLE_HOME and ORACLE_SID environment variables.  Unfortunately
at this point I am not even able to make a successful connection to the
Oracle database.  I am currently receiving the following error:

Fatal error: Call to undefined function: ocilogon() in /www/DW/oratest.php
on line 10

Do I need to recompile PHP to be Oracle aware or something?  What is
it I am missing at this point?  Thanks in advance.
Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com


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




[PHP-DB] random rows...what about tables

2002-12-17 Thread Bruce Levick
Bruce Levick - Vivamotion
Been searching for an answer to selecting a random table and then a random
row within the selected table.

I have this code which successfully selects a random row within a hard coded
table. But just can't get the random table working.

?php
//trying to select all tables from the database portfoliopfff
 $alltables = mysql_list_tables(portfolio);

//trying to get the array value of the alltables...there are 4 tables in the
database. So as far as I know the value of $alltables should be 3. (0table,
1table, 2table, 3table)
 $randtabnum = array($alltables);

// this selects everything from the Illustrations table. I need to make the
FROM table_name a random selection
 $all = mysql_query(SELECT * FROM Illustrations);

//acquires total rows
 $totalRows_Recordset1 = mysql_num_rows($all);

// selects random row from total rows
$rndm = mysql_query(SELECT * FROM Illustrations ORDER BY RAND() LIMIT
4,$totalRows_Recordset1);
 if (!$rndm) {
  echo(PError performing query:  .
   mysql_error() . /P);
  exit();
}

 $randrow = mysql_fetch_array($rndm);
 ?

Anybody see the solution??

Winxp Pro, php 4.2.2 Mysql 3.2

Cheers


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




Re: [PHP-DB] random rows...what about tables

2002-12-17 Thread Jason Wong
On Tuesday 17 December 2002 21:38, Bruce Levick wrote:
 Bruce Levick - Vivamotion
 Been searching for an answer to selecting a random table and then a random
 row within the selected table.

 I have this code which successfully selects a random row within a hard
 coded table. But just can't get the random table working.

[snip]

 Anybody see the solution??

First we need to know _what_ the problem is. I think we can assume your code 
doesn't work the way you expected. Can you tell us _how_ it doesn't work? 
Error messages?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
We place two copies of PEOPLE magazine in a DARK, HUMID mobile home.
45 minutes later CYNDI LAUPER emerges wearing a BIRD CAGE on her head!
*/


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




Re: [PHP-DB] random rows...what about tables

2002-12-17 Thread Wico de Leeuw
At 23:38 17-12-02 +1000, Bruce Levick wrote:

Bruce Levick - Vivamotion
Been searching for an answer to selecting a random table and then a random
row within the selected table.

I have this code which successfully selects a random row within a hard coded
table. But just can't get the random table working.

?php
//trying to select all tables from the database portfoliopfff
 $alltables = mysql_list_tables(portfolio);

//trying to get the array value of the alltables...there are 4 tables in the
database. So as far as I know the value of $alltables should be 3. (0table,
1table, 2table, 3table)
 $randtabnum = array($alltables);


 $randomtabel = array_rand($alltables);




// this selects everything from the Illustrations table. I need to make the
FROM table_name a random selection
 $all = mysql_query(SELECT * FROM Illustrations);

//acquires total rows
 $totalRows_Recordset1 = mysql_num_rows($all);

// selects random row from total rows
$rndm = mysql_query(SELECT * FROM Illustrations ORDER BY RAND() LIMIT
4,$totalRows_Recordset1);
 if (!$rndm) {
  echo(PError performing query:  .
   mysql_error() . /P);
  exit();
}

 $randrow = mysql_fetch_array($rndm);
 ?

Anybody see the solution??

Winxp Pro, php 4.2.2 Mysql 3.2

Cheers


--
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] session ID

2002-12-17 Thread xxx xxxx

Hi,
i'm having a problem with session Id.
I want to pass it through the pages of my site but I use a menu, a javascript menu 
with links...
i have a main page with authentification..
i register variables like name and password...but on the page linked by the menu there 
is started another session with session_start()
The code for each page looks like these:

1. main page
a form (POST)with textfiedls for name and pass

2. the val.php page
?php session_start(); ?
?php $name_req=$_POST['namefield'];
...
session_register(name);
session_register(pass);
$name=$name_req;
$pass=$_POST['passwordfield'];

//if I print the variables now ...they are correct...
then load a link to another page... index1.php

3.index1.php
?php session_start(); ?
and others...
contains the menuin javascript( another page menu.js ) with links like page2.php 
or page2.html

4. page2.php
?php session_start(); ?
and when I print the variables registered
nothing

-

what can I do?
thanks in advanced...

http://www.idilis.ro - Stiri, e-mail gratuit, download,
SMS, server de counter-strike, hosting gratuit, servicii internet...
Fii cu un pas inaintea celorlati!


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




Re: [PHP-DB] random rows...what about tables

2002-12-17 Thread Bruce Levick
Sorry,
Have updated my script with a little help. Upon output i am recieving this.

Warning: Argument to array_rand() has to be an array in
C:\WORKING\portfolio\vivamotion\site\php\request.php on line 51

this is the code below.

/

?php
//listing table in database
$alltables = mysql_list_tables(portfolio);

//random array
 $randomtable = array_rand($alltables);

 $all = mysql_query(SELECT * FROM Illustrations);
 $totalRows_Recordset1 = mysql_num_rows($all);
 $rndm = mysql_query(SELECT * FROM Illustrations ORDER BY RAND() LIMIT
4,$totalRows_Recordset1);
 if (!$rndm) {
  echo(PError performing query:  .
   mysql_error() . /P);
  exit();
}

 $randrow = mysql_fetch_array($rndm);
 ?

//output to browser
?php
print $randomtable\n;
?


Hope that helps




- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 11:48 PM
Subject: Re: [PHP-DB] random rows...what about tables


 On Tuesday 17 December 2002 21:38, Bruce Levick wrote:
  Bruce Levick - Vivamotion
  Been searching for an answer to selecting a random table and then a
random
  row within the selected table.
 
  I have this code which successfully selects a random row within a hard
  coded table. But just can't get the random table working.

 [snip]

  Anybody see the solution??

 First we need to know _what_ the problem is. I think we can assume your
code
 doesn't work the way you expected. Can you tell us _how_ it doesn't work?
 Error messages?

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *


 /*
 We place two copies of PEOPLE magazine in a DARK, HUMID mobile home.
 45 minutes later CYNDI LAUPER emerges wearing a BIRD CAGE on her head!
 */


 --
 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] real time output

2002-12-17 Thread Art Chevalier
Hello,

I want to start a native process and capture the output while it is being
generated and display it to the screen.  I dont want to output to be
displayed on the screen all at once after the process completes.  As the
process returns output I would like it dynamically displayed to the screen.

Any ideas on how I can do this???

Thanks

Art



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




RE: [PHP-DB] random rows...what about tables

2002-12-17 Thread Hutchins, Richard
I think it's because mysql_list_tables returns a resource identifier
($result). You have to iterate through the resource identifier ($result)
with a while() loop to get the actual table names out. From the PHP.NET
site:

?php
$dbname = 'mysql_dbname';

if (!mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) {
print 'Could not connect to mysql';
exit;
}

$result = mysql_list_tables($dbname);

if (!$result) {
print DB Error, could not list tables\n;
print 'MySQL Error: ' . mysql_error();
exit;
}

while ($row = mysql_fetch_row($result)) {
print Table: $row[0]\n;
}

mysql_free_result($result);
?

In the example above, I think the output would just be one table name.
However, you're going to have (and want) a list of multiple table names, if
I understand your problem correctly. In which case you'd have to put the
table names in an array called $tablenames so your array_rand($tablenames)
will work.

Haven't tested this out or done this specifically before, so I hope this
helps.
 -Original Message-
 From: Bruce Levick [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 17, 2002 9:19 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] random rows...what about tables
 
 
 Sorry,
 Have updated my script with a little help. Upon output i am 
 recieving this.
 
 Warning: Argument to array_rand() has to be an array in
 C:\WORKING\portfolio\vivamotion\site\php\request.php on line 51
 
 this is the code below.
 //
 //
 /
 
 ?php
 //listing table in database
 $alltables = mysql_list_tables(portfolio);
 
 //random array
  $randomtable = array_rand($alltables);
 
  $all = mysql_query(SELECT * FROM Illustrations);
  $totalRows_Recordset1 = mysql_num_rows($all);
  $rndm = mysql_query(SELECT * FROM Illustrations ORDER BY 
 RAND() LIMIT
 4,$totalRows_Recordset1);
  if (!$rndm) {
   echo(PError performing query:  .
mysql_error() . /P);
   exit();
 }
 
  $randrow = mysql_fetch_array($rndm);
  ?
 
 //output to browser
 ?php
 print $randomtable\n;
 ?
 
 
 Hope that helps
 
 
 
 
 - Original Message -
 From: Jason Wong [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, December 17, 2002 11:48 PM
 Subject: Re: [PHP-DB] random rows...what about tables
 
 
  On Tuesday 17 December 2002 21:38, Bruce Levick wrote:
   Bruce Levick - Vivamotion
   Been searching for an answer to selecting a random table 
 and then a
 random
   row within the selected table.
  
   I have this code which successfully selects a random row 
 within a hard
   coded table. But just can't get the random table working.
 
  [snip]
 
   Anybody see the solution??
 
  First we need to know _what_ the problem is. I think we can 
 assume your
 code
  doesn't work the way you expected. Can you tell us _how_ it 
 doesn't work?
  Error messages?
 
  --
  Jason Wong - Gremlins Associates - www.gremlins.biz
  Open Source Software Systems Integrators
  * Web Design  Hosting * Internet  Intranet Applications 
 Development *
 
 
  /*
  We place two copies of PEOPLE magazine in a DARK, HUMID mobile home.
  45 minutes later CYNDI LAUPER emerges wearing a BIRD CAGE 
 on her head!
  */
 
 
  --
  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




Re: [PHP-DB] Oracle/PHP question...

2002-12-17 Thread xxx xxxx
Hy,
in php.ini you have to uncomment the 
;extension=php_oci8.dll
;extension=php_oracle.dll

; is a comment

cybercop78




On Tue, 17 Dec 2002 08:29:36 -0500, Anthony Carlos wrote
 Yes, you need to recompile PHP: ./configure --with-oci8=[your_oracle_home]
 
 -Original Message-
 From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 16, 2002 1:58 PM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP-DB] Oracle/PHP question...
 
 I am now trying to setup connectivity to a remote Oracle database
 for my PHP/Apache web server.  I am attempting to verify 
 connectivity to the database by:
 
 ?php
 $connection = OCILogon(user, password) or die (Unable to logon 
 to database.); ?
 
 I have installed the Oracle client on the system, and I have also
 setup the ORACLE_HOME and ORACLE_SID environment variables.  Unfortunately
 at this point I am not even able to make a successful connection to the
 Oracle database.  I am currently receiving the following error:
 
 Fatal error: Call to undefined function: ocilogon() in /www/DW/oratest.php
 on line 10
 
 Do I need to recompile PHP to be Oracle aware or something?  
 What is it I am missing at this point?  Thanks in advance. Scott 
 Nipp Phone:  (214) 858-1289 E-mail:  [EMAIL PROTECTED] Web:  http:\\ldsa.sbcld.sbc.com
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





http://www.idilis.ro - Stiri, e-mail gratuit, download,
SMS, server de counter-strike, hosting gratuit, servicii internet...
Fii cu un pas inaintea celorlati!


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




Re: [PHP-DB] Oracle/PHP question...

2002-12-17 Thread xxx xxxx
Hy,
in php.ini you have to uncomment the 
;extension=php_oci8.dll
;extension=php_oracle.dll

; is a comment

and restart the server
cybercop78




On Tue, 17 Dec 2002 08:29:36 -0500, Anthony Carlos wrote
 Yes, you need to recompile PHP: ./configure --with-oci8=[your_oracle_home]
 
 -Original Message-
 From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 16, 2002 1:58 PM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP-DB] Oracle/PHP question...
 
 I am now trying to setup connectivity to a remote Oracle database
 for my PHP/Apache web server.  I am attempting to verify 
 connectivity to the database by:
 
 ?php
 $connection = OCILogon(user, password) or die (Unable to logon 
 to database.); ?
 
 I have installed the Oracle client on the system, and I have also
 setup the ORACLE_HOME and ORACLE_SID environment variables.  Unfortunately
 at this point I am not even able to make a successful connection to the
 Oracle database.  I am currently receiving the following error:
 
 Fatal error: Call to undefined function: ocilogon() in /www/DW/oratest.php
 on line 10
 
 Do I need to recompile PHP to be Oracle aware or something?  
 What is it I am missing at this point?  Thanks in advance. Scott 
 Nipp Phone:  (214) 858-1289 E-mail:  [EMAIL PROTECTED] Web:  http:\\ldsa.sbcld.sbc.com
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





http://www.idilis.ro - Stiri, e-mail gratuit, download,
SMS, server de counter-strike, hosting gratuit, servicii internet...
Fii cu un pas inaintea celorlati!


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




Re: [PHP-DB] Oracle/PHP question...

2002-12-17 Thread Andrey Hristov
AFAIK he uses *nix, not windows.
(.so-s are possible sollution but prebuilt ones are not shipped with php).

Andrey


- Original Message -
From: xxx  [EMAIL PROTECTED]
To: Anthony Carlos [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 4:32 PM
Subject: Re: [PHP-DB] Oracle/PHP question...


 Hy,
 in php.ini you have to uncomment the
 ;extension=php_oci8.dll
 ;extension=php_oracle.dll

 ; is a comment

 and restart the server
 cybercop78




 On Tue, 17 Dec 2002 08:29:36 -0500, Anthony Carlos wrote
  Yes, you need to recompile PHP:
./configure --with-oci8=[your_oracle_home]
 
  -Original Message-
  From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
  Sent: Monday, December 16, 2002 1:58 PM
  To: '[EMAIL PROTECTED]'
  Subject: [PHP-DB] Oracle/PHP question...
 
  I am now trying to setup connectivity to a remote Oracle database
  for my PHP/Apache web server.  I am attempting to verify
  connectivity to the database by:
 
  ?php
  $connection = OCILogon(user, password) or die (Unable to logon
  to database.); ?
 
  I have installed the Oracle client on the system, and I have also
  setup the ORACLE_HOME and ORACLE_SID environment variables.
Unfortunately
  at this point I am not even able to make a successful connection to the
  Oracle database.  I am currently receiving the following error:
 
  Fatal error: Call to undefined function: ocilogon() in
/www/DW/oratest.php
  on line 10
 
  Do I need to recompile PHP to be Oracle aware or something?
  What is it I am missing at this point?  Thanks in advance. Scott
  Nipp Phone:  (214) 858-1289 E-mail:  [EMAIL PROTECTED] Web:
http:\\ldsa.sbcld.sbc.com
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php





 http://www.idilis.ro - Stiri, e-mail gratuit, download,
 SMS, server de counter-strike, hosting gratuit, servicii internet...
 Fii cu un pas inaintea celorlati!


 --
 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] Oracle/PHP question...

2002-12-17 Thread NIPP, SCOTT V (SBCSI)
Correct.  I am working on Unix, specifically HP-UX 11.00.

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 8:38 AM
To: xxx ; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Oracle/PHP question... 


AFAIK he uses *nix, not windows.
(.so-s are possible sollution but prebuilt ones are not shipped with php).

Andrey


- Original Message -
From: xxx  [EMAIL PROTECTED]
To: Anthony Carlos [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 4:32 PM
Subject: Re: [PHP-DB] Oracle/PHP question...


 Hy,
 in php.ini you have to uncomment the
 ;extension=php_oci8.dll
 ;extension=php_oracle.dll

 ; is a comment

 and restart the server
 cybercop78




 On Tue, 17 Dec 2002 08:29:36 -0500, Anthony Carlos wrote
  Yes, you need to recompile PHP:
./configure --with-oci8=[your_oracle_home]
 
  -Original Message-
  From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
  Sent: Monday, December 16, 2002 1:58 PM
  To: '[EMAIL PROTECTED]'
  Subject: [PHP-DB] Oracle/PHP question...
 
  I am now trying to setup connectivity to a remote Oracle database
  for my PHP/Apache web server.  I am attempting to verify
  connectivity to the database by:
 
  ?php
  $connection = OCILogon(user, password) or die (Unable to logon
  to database.); ?
 
  I have installed the Oracle client on the system, and I have also
  setup the ORACLE_HOME and ORACLE_SID environment variables.
Unfortunately
  at this point I am not even able to make a successful connection to the
  Oracle database.  I am currently receiving the following error:
 
  Fatal error: Call to undefined function: ocilogon() in
/www/DW/oratest.php
  on line 10
 
  Do I need to recompile PHP to be Oracle aware or something?
  What is it I am missing at this point?  Thanks in advance. Scott
  Nipp Phone:  (214) 858-1289 E-mail:  [EMAIL PROTECTED] Web:
http:\\ldsa.sbcld.sbc.com
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php





 http://www.idilis.ro - Stiri, e-mail gratuit, download,
 SMS, server de counter-strike, hosting gratuit, servicii internet...
 Fii cu un pas inaintea celorlati!


 --
 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] unsuscribe please

2002-12-17 Thread ALONSO CARDENAS MARQUEZ
unsuscribe please [EMAIL PROTECTED]





_
MSN. Más Útil Cada Día http://www.msn.es/intmap/


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




Re: [PHP-DB] Oracle/PHP question...

2002-12-17 Thread Andrey Hristov
 As Anthony Carlos said - compile your php with oracle and oci support.
Then you will have all the functions from the modules. The next thing to do
after the compile (and web server restart). You said that you configured the
SID and the HOME so that's fine. Just compile new binary

Regards,
Andrey

- Original Message -
From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED]
To: 'Andrey Hristov' [EMAIL PROTECTED]; xxx  [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 4:37 PM
Subject: RE: [PHP-DB] Oracle/PHP question...


 Correct.  I am working on Unix, specifically HP-UX 11.00.

 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 17, 2002 8:38 AM
 To: xxx ; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Oracle/PHP question...


 AFAIK he uses *nix, not windows.
 (.so-s are possible sollution but prebuilt ones are not shipped with php).

 Andrey


 - Original Message -
 From: xxx  [EMAIL PROTECTED]
 To: Anthony Carlos [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, December 17, 2002 4:32 PM
 Subject: Re: [PHP-DB] Oracle/PHP question...


  Hy,
  in php.ini you have to uncomment the
  ;extension=php_oci8.dll
  ;extension=php_oracle.dll
 
  ; is a comment
 
  and restart the server
  cybercop78
 
 
 
 
  On Tue, 17 Dec 2002 08:29:36 -0500, Anthony Carlos wrote
   Yes, you need to recompile PHP:
 ./configure --with-oci8=[your_oracle_home]
  
   -Original Message-
   From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
   Sent: Monday, December 16, 2002 1:58 PM
   To: '[EMAIL PROTECTED]'
   Subject: [PHP-DB] Oracle/PHP question...
  
   I am now trying to setup connectivity to a remote Oracle database
   for my PHP/Apache web server.  I am attempting to verify
   connectivity to the database by:
  
   ?php
   $connection = OCILogon(user, password) or die (Unable to logon
   to database.); ?
  
   I have installed the Oracle client on the system, and I have also
   setup the ORACLE_HOME and ORACLE_SID environment variables.
 Unfortunately
   at this point I am not even able to make a successful connection to
the
   Oracle database.  I am currently receiving the following error:
  
   Fatal error: Call to undefined function: ocilogon() in
 /www/DW/oratest.php
   on line 10
  
   Do I need to recompile PHP to be Oracle aware or something?
   What is it I am missing at this point?  Thanks in advance. Scott
   Nipp Phone:  (214) 858-1289 E-mail:  [EMAIL PROTECTED] Web:
 http:\\ldsa.sbcld.sbc.com
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
  http://www.idilis.ro - Stiri, e-mail gratuit, download,
  SMS, server de counter-strike, hosting gratuit, servicii internet...
  Fii cu un pas inaintea celorlati!
 
 
  --
  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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] random rows...what about tables

2002-12-17 Thread Jason Wong
On Tuesday 17 December 2002 22:18, Bruce Levick wrote:
 Sorry,
 Have updated my script with a little help. Upon output i am recieving this.

 Warning: Argument to array_rand() has to be an array in
 C:\WORKING\portfolio\vivamotion\site\php\request.php on line 51


OK, start from the basics. There's an example in the manual which shows you 
how to use mysql_list_tables(). Get that working, _then_ adapt it to return 
random tables.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
QOTD:
I sprinkled some baking powder over a couple of potatoes, but it
didn't work.
*/


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




Re: [PHP-DB] Oracle/PHP question...

2002-12-17 Thread Andrey Hristov
Compile with --with-oci8

Andrey

- Original Message -
From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED]
To: 'Andrey Hristov' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 4:56 PM
Subject: RE: [PHP-DB] Oracle/PHP question...


 I am running Oracle 8.0.6.3.  Do I need both --with-oracle and
 --with-oci8?  I was under the impression that I only needed the option
 --with-oci8.  Thanks.

 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 17, 2002 8:46 AM
 To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Oracle/PHP question...


  As Anthony Carlos said - compile your php with oracle and oci support.
 Then you will have all the functions from the modules. The next thing to
do
 after the compile (and web server restart). You said that you configured
the
 SID and the HOME so that's fine. Just compile new binary

 Regards,
 Andrey

 - Original Message -
 From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED]
 To: 'Andrey Hristov' [EMAIL PROTECTED]; xxx  [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Tuesday, December 17, 2002 4:37 PM
 Subject: RE: [PHP-DB] Oracle/PHP question...


  Correct.  I am working on Unix, specifically HP-UX 11.00.
 
  -Original Message-
  From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, December 17, 2002 8:38 AM
  To: xxx ; [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] Oracle/PHP question...
 
 
  AFAIK he uses *nix, not windows.
  (.so-s are possible sollution but prebuilt ones are not shipped with
php).
 
  Andrey
 
 
  - Original Message -
  From: xxx  [EMAIL PROTECTED]
  To: Anthony Carlos [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Tuesday, December 17, 2002 4:32 PM
  Subject: Re: [PHP-DB] Oracle/PHP question...
 
 
   Hy,
   in php.ini you have to uncomment the
   ;extension=php_oci8.dll
   ;extension=php_oracle.dll
  
   ; is a comment
  
   and restart the server
   cybercop78
  
  
  
  
   On Tue, 17 Dec 2002 08:29:36 -0500, Anthony Carlos wrote
Yes, you need to recompile PHP:
  ./configure --with-oci8=[your_oracle_home]
   
-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 1:58 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] Oracle/PHP question...
   
I am now trying to setup connectivity to a remote Oracle
database
for my PHP/Apache web server.  I am attempting to verify
connectivity to the database by:
   
?php
$connection = OCILogon(user, password) or die (Unable to logon
to database.); ?
   
I have installed the Oracle client on the system, and I have
also
setup the ORACLE_HOME and ORACLE_SID environment variables.
  Unfortunately
at this point I am not even able to make a successful connection to
 the
Oracle database.  I am currently receiving the following error:
   
Fatal error: Call to undefined function: ocilogon() in
  /www/DW/oratest.php
on line 10
   
Do I need to recompile PHP to be Oracle aware or something?
What is it I am missing at this point?  Thanks in advance. Scott
Nipp Phone:  (214) 858-1289 E-mail:  [EMAIL PROTECTED] Web:
  http:\\ldsa.sbcld.sbc.com
   
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
  
  
  
  
  
   http://www.idilis.ro - Stiri, e-mail gratuit, download,
   SMS, server de counter-strike, hosting gratuit, servicii internet...
   Fii cu un pas inaintea celorlati!
  
  
   --
   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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] real time output

2002-12-17 Thread Gary . Every
Check out the flush() and ob_flush commands on www.php.net


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


-Original Message-
From: Art Chevalier [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 8:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] real time output


Hello,

I want to start a native process and capture the output while it is being
generated and display it to the screen.  I dont want to output to be
displayed on the screen all at once after the process completes.  As the
process returns output I would like it dynamically displayed to the screen.

Any ideas on how I can do this???

Thanks

Art



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



Re: [PHP-DB] login won't log in, HELP

2002-12-17 Thread David
Thank You Jason for replying back.

I am still new to this and sometimes it is hard to ask question because I
don't know all the terms or how to word my problem.

Ok I switch my php.ini to error reporting to maximum (error_reporting  =
E_ALL)  and write off the bat I got this error message.

Notice: Undefined index: Submit in c:\program files\apache
group\apache\htdocs\sunwestsilver\admin\tmp3hdt979rwz.php on line 5

My code at that line is:

#// This section is only run when the form has been submitted
#if($HTTP_POST_VARS['Submit']=='Login') (This is line 5)
#  {
#session_start();
#// Check whether the login details are correct, and put
#   // the user status into a session variable.
#   $statusCheck = check_login($HTTP_POST_VARS);
#   if ($statusCheck == Admin || $statusCheck == Staff)
#  {
#  session_register(statusCheck);
#  header(Location: menu.php);
# }
#  }

Rather than debug your code for you, here are a couple of pointers:

 1) Bypass the login page, hardcode the login details and see whether that
gets
 you logged in.

This make sense.  I will try this. I got the code from Dreamweaver MX: PHP
web Dev book  and I double checked to make sure everything was type right,
I good. I can't write code out right from the head yet.  Remember I still
new to this and I am learning by reading code and try to visualize what is
going on and now learning to troubleshoot. ;-)

 2) Use print_r() on your major variables in strategic places in your code
to
 see what's happening to them as they pass through your code.

Thx I will try this.  It will be my first time using it.

ThX for your help.  Could you help me with my error or see if this was
written it wrong.

ThX Jason

David

Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Tuesday 17 December 2002 14:42, David wrote:
  Hello,
 
  I am pretty new to PHP and I am trying to create a admin login page so
my
  client can view thier product line and orders.  I have MySQL set-up
  properly and have data in it and I am able to view information from the
db
  with no problem. I do all my testing on my local machine before I blast
it
  to the main web server.  I am using 2000XP Pro, Apache/1.3.23 (Win32)
and
  PHP Ver. 4.2.3.  The main webserver is a Unix system.
 
  The problem I am having is I created a login.php and a include page
called
  admin.inc.php.  I tried to log-in but the login.php reloads and the
login
  fields are blank. It should go to the admin.php or give me some type of
  error.  I get no errors message.  I was getting errors earlier but I
forgot
  to put a ; on one line.

 If you've set error reporting to maximum (error_reporting  =  E_ALL) and
 you're still not getting any errors then it must be some faulty logic in
your
 code.

  I going to copy my login.php and admin.inc.php code hoping that someone
  could help my and point out what am I over looking.  I put a #pound sign
in
  front of the code, I hope this is ok.

 Rather than debug your code for you, here are a couple of pointers:

 1) Bypass the login page, hardcode the login details and see whether that
gets
 you logged in.

 2) Use print_r() on your major variables in strategic places in your code
to
 see what's happening to them as they pass through your code.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *


 /*
 Wish not to seem, but to be, the best.
 -- Aeschylus
 */




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




[PHP-DB] PHP/Oracle Install questions...

2002-12-17 Thread NIPP, SCOTT V (SBCSI)
I am attempting to recompile PHP 4.2.3 on HP-UX 11.00 for
connectivity to both a MySQL and a remote Oracle server.  I am not having
much luck with this right now.  Currently I am getting a couple of different
errors that are of concern for me.  First of all, in the Apache error log I
am seeing the following entry every time I start the Apache server:

[Tue Dec 17 09:42:39 2002] [warn] module php4_module is already
loaded, skipping

I am not sure as to why I am receiving this error.  I know that PHP
is only compiled as a module, because it does not show up in a httpd -l.  I
am wondering if this is a result of some kind of syntax error in my
httpd.conf file.

The big problem though is getting PHP to compile completely again.
I know that on HP there is an issue with the extension on the php library.
It has something to do with .sl as opposed to .so, but I cannot remember
exactly what it is and for some reason I can't seem to find the
documentation on it this time around.  Any help in the right direction here
would be most appreciated.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



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




[PHP-DB] FW: PHP/Oracle Install questions...

2002-12-17 Thread NIPP, SCOTT V (SBCSI)
More information for someone to hopefully come to my rescue on
this...

root@torvalds:/usr/local/apache/bin ./apachectl startssl
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage:
/us
r/lib/libcl.2
/usr/lib/dld.sl: Exec format error
Syntax error on line 207 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server: Exec format
error
./apachectl startssl: httpd could not be started

This is what I get when I attempt to start Apache once I think I
have compiled the new PHP module properly.

  -Original Message-
 From: NIPP, SCOTT V (SBCSI)  
 Sent: Tuesday, December 17, 2002 9:56 AM
 To:   '[EMAIL PROTECTED]'
 Subject:  PHP/Oracle Install questions...
 
   I am attempting to recompile PHP 4.2.3 on HP-UX 11.00 for
 connectivity to both a MySQL and a remote Oracle server.  I am not having
 much luck with this right now.  Currently I am getting a couple of
 different errors that are of concern for me.  First of all, in the Apache
 error log I am seeing the following entry every time I start the Apache
 server:
 
   [Tue Dec 17 09:42:39 2002] [warn] module php4_module is already
 loaded, skipping
 
   I am not sure as to why I am receiving this error.  I know that PHP
 is only compiled as a module, because it does not show up in a httpd -l.
 I am wondering if this is a result of some kind of syntax error in my
 httpd.conf file.
 
   The big problem though is getting PHP to compile completely again.
 I know that on HP there is an issue with the extension on the php library.
 It has something to do with .sl as opposed to .so, but I cannot remember
 exactly what it is and for some reason I can't seem to find the
 documentation on it this time around.  Any help in the right direction
 here would be most appreciated.
 
 Scott Nipp
 Phone:  (214) 858-1289
 E-mail:  [EMAIL PROTECTED]
 Web:  http:\\ldsa.sbcld.sbc.com
 
 

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




Re: [PHP-DB] How can I use PHP to duplicate a mysql template database?

2002-12-17 Thread Rick Widmer
At 07:59 PM 12/16/02 -0800, Daevid Vincent wrote:

I need to use PHP to duplicate the schema of a database. This seems like
it should be a simple task -- taking a 'template' db and cloning it with
a new name.



The easiest way I know of is at the command line:

mysqldump -p -u root  name_of_existing_database schemafile

mysql -p -u root
mysql create database newdatabase;
mysql grant whatever on newdatabase.* to whoever
mysql exit

mysql -p -u root newdatabase  schemafile

The commands typed into the mysql interpreter must be done by a user with 
rights to create databases, the final mysql command where you import the 
schemafile must be done with a user having rights to create tables within 
the new database, the mysqldump can be done by any user with select rights 
to all tables in the existing database.


And
$sql .= CREATE TABLE IP_Dept (;
$sql .=   IP_Addr int(10) unsigned NOT NULL default
'0',;
$sql .=   DeptID int(10) unsigned NOT NULL default
'0';
$sql .= );;


With MySQL, you only get one sql statement per call to mysql_query, so call 
it here, empty the $sql variable and start on the next table.  Also, a 
trailing semicolon is not allowed in the $sql variable, so end with  $sql 
.= ); instead of $sql .= );;


Don't complain, this is a feature that prevents a common database attack 
where someone adds ;drop table users; at the end of one of your queries by 
poisoning user input.


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



RE: [PHP-DB] My question in precise reg PHP and relational tables.

2002-12-17 Thread Phanivas Vemuri
hi,
I have added my question , my main Aim at the end of this explanation.

I have two tables.

1.ProgramClips ( id, progSummary, category, videoFile)PRIMkey = id.
and each id may have 2 or three categories.

2.Category( number,category).
categories are :
Beef , diary, horticulture etc;

I am using PhpMyAdmin as the interface for the mySql Database.
The PhpMyAdmin uses a text filed to show the values of the category.

If there are two or more categories for example Beef and Diary thenBeef 
| Diary is shown in the text field.

Now I want to change that text field into a drop down list and enable 
multiple selection of the values. And if I want to update the category field 
in program clips I will select one or more values in the drop down list and 
do some programming to put a pipe symbol in between the selected values ( in 
order to make MySQL to understand and interpret).

::

My Question in Precise is
1. is there aby way in realation databases that the values that appear in 
the FORM are the values from the 'categories' table. If I add more 
categories then those values can be automatically added into the FORM from 
whcih I update the 'category' field in 'programClips' table.

_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus


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



RE: [PHP-DB] How can I use PHP to duplicate a mysql template database? [hack] bug

2002-12-17 Thread Daevid Vincent
DAMNIT!

This method copies the data, but doesn't copy 'Extra' stuff like
auto_increment.

UGH!!!

 -Original Message-
 From: Daevid Vincent [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, December 17, 2002 2:33 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] How can I use PHP to duplicate a mysql 
 template database? [hack]
 
 
 Seems to me there should be a built in SQL or PHP command to 
 duplicate a
 database. Jeepers. Or to read in a .sql file from PHP and create a
 database out of it (which was the original intent).
 
 Anyways, here's a 'hack'. I'd still love to hear anyone else's more
 elegant solution.
 
 $V2DB = V2_SL.$CompanyID;
 
 $result = mysql_create_db($V2DB, $linkI);
 if (!$result) $errorstring .= Error creating .$V2DB.
 databaseBR\n.mysql_errno($linkI).: 
 .mysql_error($linkI).BR\n; 
 
 mysql_select_db ($V2DB, $linkI) or die (Could not select .$V2DB.
 Database);
 /*
 //TODO: None of these below here work. Ugh! so frustrating!!
 //$filename = /mypath/todb/V2_DB.sql;
 //$fd = fopen ($filename, r);
 //$sql = fread ($fd, filesize ($filename));
 //fclose ($fd);
 
 //$lines = file($filename);
 //foreach ($lines as $line_num = $line) { $sql .= $line; }
 
 //$sqlTables = explode(;,$sql);
 //foreach ($sqlTables as $table)
 //{
 //echo PRE$table/PREphr\n;
 //$result = mysql_query($sql,$linkI);
 //if (!$result) $errorstring .= Error creating .$V2DB.
 .$table. tableBR\n.mysql_errno($linkI).:
 .mysql_error($linkI).BR\n; 
 //}
 */
 
 //You must have already created the V2_Template database. 
 //This will make a clone of it, including data, so most 
 likely leave it
 empty
 
 $tableResult = mysql_list_tables (V2_Template);
 while ($row = mysql_fetch_row($tableResult)) 
 {
   $tsql = CREATE TABLE .$V2DB...$row[0]. AS SELECT * FROM
 V2_Template..$row[0];
   echo $tsql.BR\n;
   $tresult = mysql_query($tsql,$linkI);
   if (!$tresult) $errorstring .= Error creating
 .$V2DB...$row[0]. tableBR\n.mysql_errno($linkI).:
 .mysql_error($linkI).BR\n; 
 }
 
 
  -Original Message-
  From: Daevid Vincent [mailto:[EMAIL PROTECTED]] 
  Sent: Monday, December 16, 2002 8:00 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] How can I use PHP to duplicate a mysql 
  template database?
  
  
  I need to use PHP to duplicate the schema of a database. This 
  seems like
  it should be a simple task -- taking a 'template' db and 
  cloning it with
  a new name. 
  
  I've tried things like:
  
  $filename = myDB.sql;
  $fd = fopen ($filename, r);
  $sql = fread ($fd, filesize ($filename));
  fclose ($fd);
  
  And 
  
  $lines = file($filename);
  foreach ($lines as $line_num = $line) { $sql .= $line;
  }
  
  And
  $sql .= CREATE TABLE IP_Dept (;
  $sql .=   IP_Addr int(10) unsigned NOT NULL default
  '0',;
  $sql .=   DeptID int(10) unsigned NOT NULL default
  '0';
  $sql .= );;
  
  $sql .= CREATE TABLE ResolveTable (;
  $sql .=   IP_Addr int(10) unsigned NOT NULL default
  '0',;
  $sql .=   Name char(255) NOT NULL default '',;
  $sql .=   Custom char(1) default NULL,;
  $sql .=   Global char(1) default 'Y',;
  $sql .=   OSVersion char(255) default NULL,;
  $sql .=   RowID int(10) unsigned NOT NULL
  auto_increment,;
  $sql .=   Display enum('Yes','No') NOT NULL default
  'Yes',;
  $sql .=   PRIMARY KEY  (RowID);
  $sql .= );;
  
  echo PRE.$sql./PREP;
  $result = mysql_query($sql,$linkI);
  
  But ALL of them fail! Ugh!!! Can I not stack commands like that? Is
  there some way to read in a .sql file via PHP?  The problem 
 is that my
  web pages are on a web server and the db is on a mysql server 
  which are
  different machines, so calling a system() or other execute style
  function won't work for me.
  
  I figured, Ah! Why don't I just make a template db on the 
 server and
  issue some SQL command to 'clone' that and rename it. You'd 
  think that
  was pretty straight forward, but I can't find any examples 
 or commands
  to do this seemingly trivial task. Ideas?
  
  
  -- 
  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] MySQL Ques: default for date field be current date

2002-12-17 Thread Michael Zornek
I'm trying to convert an ASP/Access tutorial to PHP/MySQL and have a
question regarding MySQL.

In Access one can create a date field and set the default to Date() to get
the current date but according to the mysql manual:

http://www.mysql.com/doc/en/CREATE_TABLE.html

 Default values must be constants. This means, for example, that you cannot set
 the default for a date column to be the value of a function such as NOW() or
 CURRENT_DATE.

Is there any other way to have MySQL automate this? I've heard of something
called stored procedures but am unfamiliar. -- Must this be done on the
scripting side?

Thanks,
~ Mike
-- 
MikeZornek.com
New blog, new QA column, new content everywhere!
http://www.mikezornek.com


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




Re: [PHP-DB] MySQL Ques: default for date field be current date

2002-12-17 Thread David Smith
This can be done using the 'timestamp' type for your column. Note that
this field will be updated to the current time any time the row is
modified (including when it is created).

An alternative is to do it on the scripting side with the MySQL NOW()
command like so:

INSERT INTO your_table (field1,field2,...,create_date) values(
'val1','val2',...,NOW())

The create_date field can be of type time, date, or datetime. I
recommend datetime.

--Dave

On Tue, 2002-12-17 at 22:22, Michael Zornek wrote:
 I'm trying to convert an ASP/Access tutorial to PHP/MySQL and have a
 question regarding MySQL.
 
 In Access one can create a date field and set the default to Date() to get
 the current date but according to the mysql manual:
 
 http://www.mysql.com/doc/en/CREATE_TABLE.html
 
  Default values must be constants. This means, for example, that you cannot set
  the default for a date column to be the value of a function such as NOW() or
  CURRENT_DATE.
 
 Is there any other way to have MySQL automate this? I've heard of something
 called stored procedures but am unfamiliar. -- Must this be done on the
 scripting side?
 
 Thanks,
 ~ Mike
 -- 
 MikeZornek.com
 New blog, new QA column, new content everywhere!
 http://www.mikezornek.com
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP-DB] MySQL Ques: default for date field be current date

2002-12-17 Thread John W. Holmes
 I'm trying to convert an ASP/Access tutorial to PHP/MySQL and have a
 question regarding MySQL.
 
 In Access one can create a date field and set the default to Date()
to
 get
 the current date but according to the mysql manual:
 
 http://www.mysql.com/doc/en/CREATE_TABLE.html
 
  Default values must be constants. This means, for example, that you
 cannot set
  the default for a date column to be the value of a function such as
 NOW() or
  CURRENT_DATE.
 
 Is there any other way to have MySQL automate this? I've heard of
 something
 called stored procedures but am unfamiliar. -- Must this be done on
the
 scripting side?

If you make your column a TIMESTAMP, it will be updated with the current
time when the row is inserted or updated, unless you set it to a
specific time. 

So, if a table has two columns, name and time, then you can do this and
the time column will be set to the current date time. 

INSERT INTO table (name, time) VALUES ('name',NULL);
INSERT INTO table (name) VALUES ('name');

Hope that helps. 

---John W. Holmes...

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



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




[PHP-DB] problem with PHP+flash programming

2002-12-17 Thread Hermanto Kurniawan
i have a problem with this flash actionscript :
loadVariablesNum 
(GuestBook.php?NumLow=+NumLow+NumHigh=+NumHigh+R=+random(999), 0);

when i run this script i got an error message like this :
error opening URL file:///C|/path/GuestBook.php?NumLow=0NumHigh=10R=470

does anyone know what is the problem with this script?

_
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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