RE: [PHP-DB] HEAP table

2003-07-09 Thread Terry Riley
Thanks, Daevid

I'll probably use something with session variables. 

However, what I wish is that there was some kind of application-wide 
variables, as can be set in ColdFusion, that could track this. I cannot 
find any means to create such variables in PHP. 

Anyone got any ideas on those lines?

Cheers
Terry

--Original Message-  

 Or instead of creating a table and tying up one more mysql thread, just 
 save
 the timestamp in a file. This could be as simple as that, you could use 
 XML,
 you could use INI parser, you could use any number of things. Also, if 
 the
 HEAP is created per session, then just store that timestamp in a 
 session
 variable and avoid any disk i/o that way.
 
  -Original Message-
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] 
  Sent: Tuesday, July 08, 2003 9:24 AM
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: RE: [PHP-DB] HEAP table
  
  
   Create a create_date table with one record, one or two 
  fields, and put the
  last refreshed time/date in it. If that's expired, refresh
  
  
  Gary Every
  Sr. UNIX Administrator
  Ingram Entertainment
  (615) 287-4876
  Pay It Forward
  mailto:[EMAIL PROTECTED]
  http://accessingram.com
  
  
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, July 08, 2003 10:52 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP-DB] HEAP table
   
   
   I have a query that I would have liked to cache, but as it uses 
   UNIX_TIMESTAMP and has a user variable in it, where cacheing 
   won't work, I 
   looked around for another way to do it (it is used to create 
   a smallish  
   50 records table on each web page, so any speed increase is 
   worthwhile).
   
   I decided to go for the creation of a HEAP table, so that 
   anyone accessing 
   the site would automatically access it. The existence of 
  the table is 
   tested for before initial creation by running a select 
  against it and 
   testing the $result variable.
   
   This works, as far as it goes, but it will require occasional 
   updating. 
   And that's where I've come unstuck. How can I test for the 
   time/date of 
   the HEAP table's creation? If I can find that, then I can set 
   a seconds 
   value past which it should be dropped and recreated.
   
   Any ideas?
   
   Using MySQL 5.0.13, php 4.3.2 (on Windows XP), Apache 1.3 
   whatever. This 
   also has to work on the website proper, using 5.0.13/4.3.1 and IIS5.
   
   Terry Riley


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



Re: RE: [PHP-DB] HEAP table

2003-07-09 Thread Terry Riley
Brandy - that's two messages in this thread from you with no content!

Terry

--Original Message-  


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



RE: [PHP-DB] HEAP table

2003-07-09 Thread Terry Riley
Good idea, Ben. I'll remember that when I can afford to have hosting on a 
non-shared server :-) , but can't use it at the moment.

Cheers
Terry

--Original Message-  

 You could have a php file set variables or an array called
 $GLOBAL[some_global_variable], go into the php.ini and set auto_prepend
 to this file. So EVERY php script that is called will first load this
 file.
 
 Ben
 
 -Original Message-
 From: Terry Riley [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, July 09, 2003 4:08 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] HEAP table
 
 
 Thanks, Daevid
 
 I'll probably use something with session variables. 
 
 However, what I wish is that there was some kind of application-wide 
 variables, as can be set in ColdFusion, that could track this. I cannot 
 find any means to create such variables in PHP. 
 
 Anyone got any ideas on those lines?
 
 Cheers
 Terry
 
 --Original Message-  
 
  Or instead of creating a table and tying up one more mysql thread, 
  just
  save
  the timestamp in a file. This could be as simple as that, you could
 use 
  XML,
  you could use INI parser, you could use any number of things. Also, if
 
  the
  HEAP is created per session, then just store that timestamp in a 
  session
  variable and avoid any disk i/o that way.
  
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] 
   Sent: Tuesday, July 08, 2003 9:24 AM
   To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Subject: RE: [PHP-DB] HEAP table
   
   
Create a create_date table with one record, one or two
   fields, and put the
   last refreshed time/date in it. If that's expired, refresh
   
   
   Gary Every
   Sr. UNIX Administrator
   Ingram Entertainment
   (615) 287-4876
   Pay It Forward
   mailto:[EMAIL PROTECTED]
   http://accessingram.com
   
   
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 10:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] HEAP table


I have a query that I would have liked to cache, but as it uses
UNIX_TIMESTAMP and has a user variable in it, where cacheing 
won't work, I 
looked around for another way to do it (it is used to create 
a smallish  
50 records table on each web page, so any speed increase is 
worthwhile).

I decided to go for the creation of a HEAP table, so that
anyone accessing 
the site would automatically access it. The existence of 
   the table is
tested for before initial creation by running a select
   against it and
testing the $result variable.

This works, as far as it goes, but it will require occasional
updating. 
And that's where I've come unstuck. How can I test for the 
time/date of 
the HEAP table's creation? If I can find that, then I can set 
a seconds 
value past which it should be dropped and recreated.

Any ideas?

Using MySQL 5.0.13, php 4.3.2 (on Windows XP), Apache 1.3
whatever. This 
also has to work on the website proper, using 5.0.13/4.3.1 and
 IIS5.


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



Re: RE: [PHP-DB] HEAP table

2003-07-09 Thread Terry Riley
Just remembered - this is the guy ([EMAIL PROTECTED]) that was so 
abominably rude a couple of weeks back. 

He's obviously found another way of shooting blanks!

--Original Message-  

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



[PHP-DB] PHP, MySQL and Flash

2003-07-09 Thread Rankin, Randy
Does anyone know of any articles on integrating PHP, MySQL and Flash to
perform a drag and drop routine for updating a db?

Specifically, I have a client who is _INSISTING_ that I integrate a drag and
drop feature into his railcar storage application. He wants to be able to
view two railcar storage tracks, Track A and Track B, then drag and drop
cars from Track A to Track B ( or Track B to Track A ). Once he positions (
orders ) all the cars properly on each track, I need to update a MySQL db to
reflect the changes. 

I have already developed the above feature so that he can do this
'textually', but he is _determined_ that he must have the graphic 'drag and
drop' feature. 

There may be another method ( Javascript ? ) to accomplish the same effect.
I am certainly open to any advice and/or opinions. Any pointers would be
_greatly_ appreciated.

Thanks, 

Randy Rankin



[PHP-DB] Auto inc in MySQL

2003-07-09 Thread Tristan . Pretty
I know I'll get flamed for askign such a simple question, but here goes...

I have a MySQL DB and wanna increment a field 'id_number' by one each 
time, to avoid creating duplicates...
I've done it before, but can't remember how...
Any ideas?

Tris...

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



RE: [PHP-DB] Auto inc in MySQL

2003-07-09 Thread Rich Hutchins
Tristan,

It is a simple question and the answer be found very easily in the MySQL
manual. All you need to do is to create a column in your table of type
AUTO_INCREMENT. Then, when you insert a row into the table, you simply
insert NULL as the value for the auto-incremented column and it will be
automatically incremented to the next value.

Other questions normally related to this topic:
1. Don't worry about gaps in the values in this field when you delete
information from the table. These auto-incremented values are only meant to
be identifiers, not necessarily ordinal values, for your table.

2. To find out the value of the ID of the last row inserted into a table
with an AUTO_INCREMENT column, use PHP's mysql_insert_id() function.

Hope this helps.
Rich


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 09, 2003 8:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Auto inc in MySQL


I know I'll get flamed for askign such a simple question, but here goes...

I have a MySQL DB and wanna increment a field 'id_number' by one each
time, to avoid creating duplicates...
I've done it before, but can't remember how...
Any ideas?

Tris...

*
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***



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



Re: [PHP-DB] Auto inc in MySQL

2003-07-09 Thread dpgirago


Tris,

 make the the field, id_number, an auto_increment field.






[EMAIL PROTECTED] on 07/09/2003 07:44:34
AM

To:   [EMAIL PROTECTED]
cc:(bcc: David P. Giragosian/MDACC)

Subject:  [PHP-DB] Auto inc in MySQL



I know I'll get flamed for askign such a simple question, but here goes...

I have a MySQL DB and wanna increment a field 'id_number' by one each
time, to avoid creating duplicates...
I've done it before, but can't remember how...
Any ideas?

Tris...

*
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***







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



Re: [PHP-DB] Delete constraint

2003-07-09 Thread Norma Ramirez - TECNOSOFT
Thank´s a lot Pascal, it works just fine and all those links have very
useful information. =)


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



RE: [PHP-DB] PHP, MySQL and Flash

2003-07-09 Thread Rich Hutchins
Randy,

There ARE javascript solutions for this and a few can be found here:
http://www.webreference.com/programming/javascript/dragdropie/
http://www.walterzorn.com/dragdrop/dragdrop_e.htm
http://www.webreference.com/dhtml/column7/ (particularly good)

What you'll find is that JS does not natively support the drag and drop
feature and that either some type of wrapper needs to be built to make it
possible or a bunch of functions. Furthermore, there may be cross-browser
compatability issues depending on the WAY you want your drag and drop to
work. And you always have the possibility that some genius might turn off
the JS support in his or her browser thereby completely killing your nice
script. But it sounds like you might have some control over this with your
client(?).

If you were to pick a JS solution, I think the third link has the most
potential, but that's just my opinion and it's going to take some keen work
to figure out a way to pass the car positions from the objects back into
form elements that can be passed to PHP. I've done that kind of work before
and it's rather clunky. If I knew Flash better, I'd actually lean towards
avoiding the JS route.

With that in mind, I did a little searching on Google using drag and drop
+flash and the search yielded a whole bunch of results which varied from how
to drag and drop on the Flash stage to actually designing the client-side
functionality you want. I'd suggest performing the same search yourself and
finding the information that best suits your needs.

If you get a solution working with JS, please post it or let me know. I'd be
interested in looking at one that actually works with PHP to move data back
and forth rather than just do jigsaw puzzles or whatever.

Hope this helps,
Rich

-Original Message-
From: Rankin, Randy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 09, 2003 8:37 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP, MySQL and Flash


Does anyone know of any articles on integrating PHP, MySQL and Flash to
perform a drag and drop routine for updating a db?

Specifically, I have a client who is _INSISTING_ that I integrate a drag and
drop feature into his railcar storage application. He wants to be able to
view two railcar storage tracks, Track A and Track B, then drag and drop
cars from Track A to Track B ( or Track B to Track A ). Once he positions (
orders ) all the cars properly on each track, I need to update a MySQL db to
reflect the changes.

I have already developed the above feature so that he can do this
'textually', but he is _determined_ that he must have the graphic 'drag and
drop' feature.

There may be another method ( Javascript ? ) to accomplish the same effect.
I am certainly open to any advice and/or opinions. Any pointers would be
_greatly_ appreciated.

Thanks,

Randy Rankin



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



[PHP-DB] OCIPLogon

2003-07-09 Thread Sapporo
Hi,

I'm trying to avoid excessive database connections within my app.

From the docs, I figured that the following code would insert 2 rows of 
data into table Dummy, since the connection would be reused and the 
transactions aren't isolated by using OCINLogon() (error handling left 
out for readability):

$conn = OCIPLogon(scott, tiger, testdb);
$statement = OCIparse($conn, INSERT INTO Dummy VALUES ('A'));
OCIexecute($statement, OCI_DEFAULT);
$conn = OCIPLogon(scott, tiger, testdb);
$statement = OCIparse($conn, INSERT INTO Dummy VALUES ('B'));
OCIexecute($statement, OCI_DEFAULT);
OCICommit($conn);

But it turns out that only the second row gets written to the database. 
So, what difference would it make to use OCINLogon()? Is this the 
expected behaviour?

How does everyone else handle this? Is it possible to store database 
connections in a session?

TIA,
-sapporo.
BTW, I'm using PHP 4.3 on Linux talking to Oracle9i.

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


Fwd: [PHP-DB] PHP, MySQL and Flash

2003-07-09 Thread . ma
hi!

flash offers some great actionscript-functions to work with php (or any 
other serversided language) over http

there is an object called LoadVars - i do not exactly know how to 
handle it within flash, but it can access php-scripts over http and 
send some post or get variables to it. in this script you can connect 
to the sql-db and update it using the information provided by the swf.

maybe there are ready drag'n'drop-components: 
http://www.macromedia.com/devnet/mx/flash/components.html
(specally http://www.macromedia.com/devnet/mx/flash/php.html)

or take a short look at http://www.flashkit.com (maybe you find some 
resources there)

hope this helps? .ma

Am Mittwoch, 09.07.03 um 14:36 Uhr schrieb Rankin, Randy:

Does anyone know of any articles on integrating PHP, MySQL and Flash to
perform a drag and drop routine for updating a db?
Specifically, I have a client who is _INSISTING_ that I integrate a 
drag and
drop feature into his railcar storage application. He wants to be able 
to
view two railcar storage tracks, Track A and Track B, then drag and 
drop
cars from Track A to Track B ( or Track B to Track A ). Once he 
positions (
orders ) all the cars properly on each track, I need to update a MySQL 
db to
reflect the changes.

I have already developed the above feature so that he can do this
'textually', but he is _determined_ that he must have the graphic 
'drag and
drop' feature.

There may be another method ( Javascript ? ) to accomplish the same 
effect.
I am certainly open to any advice and/or opinions. Any pointers would 
be
_greatly_ appreciated.

Thanks,

Randy Rankin




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


RE: [PHP-DB] OCIPLogon

2003-07-09 Thread RENAULT, François

the first OCIexecute($statement, OCI_DEFAULT); 
has not been commited
so when you reconnect ,  your cursor is closed and rollbacked with the 2nd PLogon 

-Message d'origine-
De : Sapporo [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 9 juillet 2003 16:03
À : [EMAIL PROTECTED]
Objet : [PHP-DB] OCIPLogon


Hi,

I'm trying to avoid excessive database connections within my app.

 From the docs, I figured that the following code would insert 2 rows of 
data into table Dummy, since the connection would be reused and the 
transactions aren't isolated by using OCINLogon() (error handling left 
out for readability):

$conn = OCIPLogon(scott, tiger, testdb);
$statement = OCIparse($conn, INSERT INTO Dummy VALUES ('A'));
OCIexecute($statement, OCI_DEFAULT);

$conn = OCIPLogon(scott, tiger, testdb);
$statement = OCIparse($conn, INSERT INTO Dummy VALUES ('B'));
OCIexecute($statement, OCI_DEFAULT);

OCICommit($conn);

But it turns out that only the second row gets written to the database. 
So, what difference would it make to use OCINLogon()? Is this the 
expected behaviour?

How does everyone else handle this? Is it possible to store database 
connections in a session?

TIA,
-sapporo.

BTW, I'm using PHP 4.3 on Linux talking to Oracle9i.


-- 
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] Weird Segfaults with Oracle, PHP, Apache2

2003-07-09 Thread Harris, Jeff


-Original Message-
From: Thies C. Arntzen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 09, 2003 5:33 AM
To: Harris, Jeff
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP-DB] Weird Segfaults with Oracle, PHP, Apache2


On Tue, Jul 08, 2003 at 05:51:47PM -0500, Harris, Jeff wrote:
 
 We're getting segfaults (11) when we try and execute a simple piece of
 Oracle PHP code. This is a new installation and compilation of Apache2 and
 we're just trying to see what is wrong. This particular code works on all
of
 our Apache 1.3 installations.
 
 Versions: Redhat 8.0, PHP version 4.3.2, Apache version 2.0.46, Oracle
 version 9i 9.2.0.1.0
 
 We've worked through all of the oracle user issues with Apache, made sure
 and set ORACLE_HOME and TNS_ADMIN.
 
 the code we're executing is:
 
 ?php
 
 echo 'here';
 $conn = OCILogon(scott,tiger,db);
 echo 'here2';
 
 $stmt = OCIParse($conn, select original_system_reference, attribute8 from
 apps.so_headers_interface_all where error_flag = 'Y');
 
 echo 'here3';
 
 OCIDefineByName($stmt, ORIGINAL_SYSTEM_REFERENCE, $order_number);
 OCIDefineByName($stmt, ATTRIBUTE8, $attribute8);
 
 OCIExecute($stmt);
 echo 'here4';
 
 while (OCIFetch($stmt)) {
 echo 'here5';
   echo $order_number.;
   echo : .$attribute8.br;
 }
 
 echo 'here6';
   echo $order_number.;
 OCIFreeStatement($stmt);
 OCILogoff($conn);
 echo 'here7';
 ?
 
 
 
 The server segfaults right after it gets to here3. If you comment out
 everything after here3, the page works fine. Running the $stmt select
works
 fine if you use sqlplus. I'm not sure why it's dying.

does it also crash when you are not using DefineByName?

re,
tc


Yes, it dies on the OCIExecute.

Jeff



Re: [PHP-DB] Auto inc in MySQL

2003-07-09 Thread Leif K-Brooks
Stan Lemon wrote:

Also, I believe in addition to AUTO_INCREMENT it has to be UNIQUE as 
well.  Please correct me if I am wrong.
No, just INDEX.  UNIQUE will work fine, but I reccomend making it PRIMARY.

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP-DB] Re: OCIPLogon

2003-07-09 Thread Pete Morganic
 $conn = OCIPLogon(scott, tiger, testdb);

 $statement = OCIparse($conn, INSERT INTO Dummy VALUES ('A'));
 OCIexecute($statement, OCI_DEFAULT);

 $statement = OCIparse($conn, INSERT INTO Dummy VALUES ('B'));
 OCIexecute($statement, OCI_DEFAULT);

 $statement = OCIparse($conn, INSERT INTO Dummy VALUES ('C'));
 OCIexecute($statement, OCI_DEFAULT);
 OCICommit($conn);



Sapporo wrote:
Hi,

I'm trying to avoid excessive database connections within my app.

 From the docs, I figured that the following code would insert 2 rows of 
data into table Dummy, since the connection would be reused and the 
transactions aren't isolated by using OCINLogon() (error handling left 
out for readability):

$conn = OCIPLogon(scott, tiger, testdb);
$statement = OCIparse($conn, INSERT INTO Dummy VALUES ('A'));
OCIexecute($statement, OCI_DEFAULT);
$conn = OCIPLogon(scott, tiger, testdb);
$statement = OCIparse($conn, INSERT INTO Dummy VALUES ('B'));
OCIexecute($statement, OCI_DEFAULT);
OCICommit($conn);

But it turns out that only the second row gets written to the database. 
So, what difference would it make to use OCINLogon()? Is this the 
expected behaviour?

How does everyone else handle this? Is it possible to store database 
connections in a session?

TIA,
-sapporo.
BTW, I'm using PHP 4.3 on Linux talking to Oracle9i.



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


[PHP-DB] mysql_fetch_array issues.

2003-07-09 Thread Greg Hetrick
I am getting the following error when attempting to pull data out of a mysql
DB

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in /home/pffl/public_html/pffl/webpage/html/dataentry.php on line
125

I can take this same code to a different web server and it is pulling
correctly!

I am currently running Apache 2.0.46 with PHP 4.3.2 I was running Apache
1.3.x with PHP 4.3.1 and getting the same thing, any ideas? here is the
chunk of code where I use the function.

while ($myrow=mysql_fetch_array($result))
{
?
option value=?print $myrow['name'];?, ?print
$myrow['team'];? ? echo $myrow[name]; ?/option
?
}

Any Ideas.



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



Re: [PHP-DB] mysql_fetch_array issues.

2003-07-09 Thread jeffrey_n_Dyke

Do you have an 'or die(mysql_error())'  statement following your
mysql_query($result) line.  99% of the time, this error means your query
failed.  if it works on another serverare the fields the same, the
dbname, the tablename?

hth
jeff


   
 
  Greg Hetrick   
 
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
   
  net cc: 
 
   Subject:  [PHP-DB] mysql_fetch_array 
issues. 
  07/09/2003 12:04 
 
  PM   
 
   
 
   
 




I am getting the following error when attempting to pull data out of a
mysql
DB

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in /home/pffl/public_html/pffl/webpage/html/dataentry.php on line
125

I can take this same code to a different web server and it is pulling
correctly!

I am currently running Apache 2.0.46 with PHP 4.3.2 I was running Apache
1.3.x with PHP 4.3.1 and getting the same thing, any ideas? here is the
chunk of code where I use the function.

while ($myrow=mysql_fetch_array($result))
{
?
option value=?print $myrow['name'];?, ?print
$myrow['team'];? ? echo $myrow[name]; ?/option
?
}

Any 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



Re: [PHP-DB] mysql_fetch_array issues.

2003-07-09 Thread Terry Riley
As far as I know, that error means that the query that was supposed to 
produce $result did not run because of errors in the SQL (or the 
database).

Suggest you check your query in myPHPAdmin or MySQLfront or whatever to be 
sure that it has no errors.

Terry

--Original Message-  

 I am getting the following error when attempting to pull data out of a 
 mysql
 DB
 
 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL 
 result
 resource in /home/pffl/public_html/pffl/webpage/html/dataentry.php on 
 line
 125
 
 I can take this same code to a different web server and it is pulling
 correctly!
 
 I am currently running Apache 2.0.46 with PHP 4.3.2 I was running Apache
 1.3.x with PHP 4.3.1 and getting the same thing, any ideas? here is the
 chunk of code where I use the function.
 
 while ($myrow=mysql_fetch_array($result))
 {
 ?
 option value=?print $myrow['name'];?, ?print
 $myrow['team'];? ? echo $myrow[name]; ?/option
 ?
 }
 
 Any Ideas.
 



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



Re: [PHP-DB] mysql_fetch_array issues.

2003-07-09 Thread Greg Hetrick
I do not have the die statment -- the DB is the same except the name and I
have double checked that I just did a back up of the previous db and moved
it to the new server. I have done some more digging, my query appears to
work, but I almost appears that I have a problem with selecting the
database --
if I comment out the mysql_select -- statment I get the same error, perhaps
I just can't get to that DB.
intresting.

I guess I can assume at this point there is something flaky with my DB


Jeffrey N Dyke [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 Do you have an 'or die(mysql_error())'  statement following your
 mysql_query($result) line.  99% of the time, this error means your query
 failed.  if it works on another serverare the fields the same, the
 dbname, the tablename?

 hth
 jeff



   Greg Hetrick
   [EMAIL PROTECTED]To:
[EMAIL PROTECTED]
   net cc:
Subject:  [PHP-DB]
mysql_fetch_array issues.
   07/09/2003 12:04
   PM






 I am getting the following error when attempting to pull data out of a
 mysql
 DB

 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result
 resource in /home/pffl/public_html/pffl/webpage/html/dataentry.php on line
 125

 I can take this same code to a different web server and it is pulling
 correctly!

 I am currently running Apache 2.0.46 with PHP 4.3.2 I was running Apache
 1.3.x with PHP 4.3.1 and getting the same thing, any ideas? here is the
 chunk of code where I use the function.

 while ($myrow=mysql_fetch_array($result))
 {
 ?
 option value=?print $myrow['name'];?, ?print
 $myrow['team'];? ? echo $myrow[name]; ?/option
 ?
 }

 Any 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



Re: [PHP-DB] mysql_fetch_array issues.

2003-07-09 Thread Greg Hetrick
Query is correct appears to be a problem connecting to the db -- I can
comment out the mysql_select line and I get no change.

Terry Riley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 As far as I know, that error means that the query that was supposed to
 produce $result did not run because of errors in the SQL (or the
 database).

 Suggest you check your query in myPHPAdmin or MySQLfront or whatever to be
 sure that it has no errors.

 Terry

 --Original Message-

  I am getting the following error when attempting to pull data out of a
  mysql
  DB
 
  Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
  result
  resource in /home/pffl/public_html/pffl/webpage/html/dataentry.php on
  line
  125
 
  I can take this same code to a different web server and it is pulling
  correctly!
 
  I am currently running Apache 2.0.46 with PHP 4.3.2 I was running Apache
  1.3.x with PHP 4.3.1 and getting the same thing, any ideas? here is the
  chunk of code where I use the function.
 
  while ($myrow=mysql_fetch_array($result))
  {
  ?
  option value=?print $myrow['name'];?, ?print
  $myrow['team'];? ? echo $myrow[name]; ?/option
  ?
  }
 
  Any Ideas.
 





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



RE: [PHP-DB] mysql_fetch_array issues.

2003-07-09 Thread Gary . Every
Do you have select permissions on that DB/table?

If you have GRANT permissions, try
GRANS SELECT, INSERT, UPDATE, DELETE ON db.tablename to
'youruser'@'your.ip.address' IDENTIFIED BY 'yourpassword';

your.ip.address can be substituted with localhost if you're on the same box.


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


 -Original Message-
 From: Greg Hetrick [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 09, 2003 12:31 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] mysql_fetch_array issues.
 
 
 I do not have the die statment -- the DB is the same except 
 the name and I
 have double checked that I just did a back up of the previous 
 db and moved
 it to the new server. I have done some more digging, my query 
 appears to
 work, but I almost appears that I have a problem with selecting the
 database --
 if I comment out the mysql_select -- statment I get the same 
 error, perhaps
 I just can't get to that DB.
 intresting.
 
 I guess I can assume at this point there is something flaky with my DB
 
 
 Jeffrey N Dyke [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
  Do you have an 'or die(mysql_error())'  statement following your
  mysql_query($result) line.  99% of the time, this error 
 means your query
  failed.  if it works on another serverare the fields 
 the same, the
  dbname, the tablename?
 
  hth
  jeff
 
 
 
Greg Hetrick
[EMAIL PROTECTED]To:
 [EMAIL PROTECTED]
net cc:
 Subject:  [PHP-DB]
 mysql_fetch_array issues.
07/09/2003 12:04
PM
 
 
 
 
 
 
  I am getting the following error when attempting to pull 
 data out of a
  mysql
  DB
 
  Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
 result
  resource in 
 /home/pffl/public_html/pffl/webpage/html/dataentry.php on line
  125
 
  I can take this same code to a different web server and it 
 is pulling
  correctly!
 
  I am currently running Apache 2.0.46 with PHP 4.3.2 I was 
 running Apache
  1.3.x with PHP 4.3.1 and getting the same thing, any ideas? 
 here is the
  chunk of code where I use the function.
 
  while ($myrow=mysql_fetch_array($result))
  {
  ?
  option value=?print $myrow['name'];?, ?print
  $myrow['team'];? ? echo $myrow[name]; ?/option
  ?
  }
 
  Any 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
 


Re: [PHP-DB] mysql_fetch_array issues.

2003-07-09 Thread Greg Hetrick
Yup, I have all permissions -- it appears that I can access mysql but not
the database itself.

Gary Every [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
.
 Do you have select permissions on that DB/table?

 If you have GRANT permissions, try
 GRANS SELECT, INSERT, UPDATE, DELETE ON db.tablename to
 'youruser'@'your.ip.address' IDENTIFIED BY 'yourpassword';

 your.ip.address can be substituted with localhost if you're on the same
box.


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


  -Original Message-
  From: Greg Hetrick [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 09, 2003 12:31 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] mysql_fetch_array issues.
 
 
  I do not have the die statment -- the DB is the same except
  the name and I
  have double checked that I just did a back up of the previous
  db and moved
  it to the new server. I have done some more digging, my query
  appears to
  work, but I almost appears that I have a problem with selecting the
  database --
  if I comment out the mysql_select -- statment I get the same
  error, perhaps
  I just can't get to that DB.
  intresting.
 
  I guess I can assume at this point there is something flaky with my DB
 
 
  Jeffrey N Dyke [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  
   Do you have an 'or die(mysql_error())'  statement following your
   mysql_query($result) line.  99% of the time, this error
  means your query
   failed.  if it works on another serverare the fields
  the same, the
   dbname, the tablename?
  
   hth
   jeff
  
  
  
 Greg Hetrick
 [EMAIL PROTECTED]To:
  [EMAIL PROTECTED]
 net cc:
  Subject:  [PHP-DB]
  mysql_fetch_array issues.
 07/09/2003 12:04
 PM
  
  
  
  
  
  
   I am getting the following error when attempting to pull
  data out of a
   mysql
   DB
  
   Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
  result
   resource in
  /home/pffl/public_html/pffl/webpage/html/dataentry.php on line
   125
  
   I can take this same code to a different web server and it
  is pulling
   correctly!
  
   I am currently running Apache 2.0.46 with PHP 4.3.2 I was
  running Apache
   1.3.x with PHP 4.3.1 and getting the same thing, any ideas?
  here is the
   chunk of code where I use the function.
  
   while ($myrow=mysql_fetch_array($result))
   {
   ?
   option value=?print $myrow['name'];?, ?print
   $myrow['team'];? ? echo $myrow[name]; ?/option
   ?
   }
  
   Any 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] mssql_bind problems

2003-07-09 Thread Chris Wright
I am running PHP 4.3.2 and MS-SQL 2000.   I am trying to run some sample
code to make sure all works well.
The code below works fine.   It simply inserts a record into a table.  This
is done in the stored procedure code on the SQL server.

Code that works:
$myServer = 192.168.200.28;
$myUser = sa;
$myPass = xx;
$myDB = Northwind;

$s = @mssql_connect($myServer, $myUser, $myPass)
or die(Couldn't connect to SQL Server on $myServer);

$d = @mssql_select_db($myDB, $s)
or die(Couldn't open database $myDB);

$query = mssql_init(sp_addnewshipper, $s);
$result = mssql_execute($query);

However, when I try to pass a variable via the following code, I get an
error from my proxy server saying Zero sized reply.  The problem seems to
be with the mssql_bind line.

Code that doesn't work:

$myServer = 192.168.200.28;
$myUser = sa;
$myPass = xx;
$myDB = Northwind;

$s = @mssql_connect($myServer, $myUser, $myPass)
or die(Couldn't connect to SQL Server on $myServer);

$d = @mssql_select_db($myDB, $s)
or die(Couldn't open database $myDB);

$query = mssql_init(sp_getprod, $s);
$supid = 2;
mssql_bind($query, @supplierid, $supid, SQLINT2,true);
$result = mssql_execute($query);
$numProds = mssql_num_rows($result);


echo h1 . $numProds .  Product;

while($row = mssql_fetch_array($result))
{
echo li.$row[0].li;
}

?



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



Re: [PHP-DB] mysql_fetch_array issues.

2003-07-09 Thread Kieu D. Trang
this error only means that your msql_query($result) was correct, but did
not have any result...  meaning, there was nothing to select, there for
there is nothing to fetch...  hence you can not do a msql_fetch_array() on
an empty result set.

KD


On Wed, 9 Jul 2003, Greg Hetrick wrote:

 Yup, I have all permissions -- it appears that I can access mysql but not
 the database itself.

 Gary Every [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 .
  Do you have select permissions on that DB/table?
 
  If you have GRANT permissions, try
  GRANS SELECT, INSERT, UPDATE, DELETE ON db.tablename to
  'youruser'@'your.ip.address' IDENTIFIED BY 'yourpassword';
 
  your.ip.address can be substituted with localhost if you're on the same
 box.
 
 
  Gary Every
  Sr. UNIX Administrator
  Ingram Entertainment
  (615) 287-4876
  Pay It Forward
  mailto:[EMAIL PROTECTED]
  http://accessingram.com
 
 
   -Original Message-
   From: Greg Hetrick [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 09, 2003 12:31 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP-DB] mysql_fetch_array issues.
  
  
   I do not have the die statment -- the DB is the same except
   the name and I
   have double checked that I just did a back up of the previous
   db and moved
   it to the new server. I have done some more digging, my query
   appears to
   work, but I almost appears that I have a problem with selecting the
   database --
   if I comment out the mysql_select -- statment I get the same
   error, perhaps
   I just can't get to that DB.
   intresting.
  
   I guess I can assume at this point there is something flaky with my DB
  
  
   Jeffrey N Dyke [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
   
Do you have an 'or die(mysql_error())'  statement following your
mysql_query($result) line.  99% of the time, this error
   means your query
failed.  if it works on another serverare the fields
   the same, the
dbname, the tablename?
   
hth
jeff
   
   
   
  Greg Hetrick
  [EMAIL PROTECTED]To:
   [EMAIL PROTECTED]
  net cc:
   Subject:  [PHP-DB]
   mysql_fetch_array issues.
  07/09/2003 12:04
  PM
   
   
   
   
   
   
I am getting the following error when attempting to pull
   data out of a
mysql
DB
   
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
   result
resource in
   /home/pffl/public_html/pffl/webpage/html/dataentry.php on line
125
   
I can take this same code to a different web server and it
   is pulling
correctly!
   
I am currently running Apache 2.0.46 with PHP 4.3.2 I was
   running Apache
1.3.x with PHP 4.3.1 and getting the same thing, any ideas?
   here is the
chunk of code where I use the function.
   
while ($myrow=mysql_fetch_array($result))
{
?
option value=?print $myrow['name'];?, ?print
$myrow['team'];? ? echo $myrow[name]; ?/option
?
}
   
Any 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php