[PHP-DB] error checking question

2003-06-26 Thread dpgirago


Hello everyone,

I've been experimenting with checking for errors in data inserted into a table
using an html form.  The main page displays the result of a  select  *  from
the_table at the top of the page, with the form for inserting the data beneath.
The SQL for the insert occurs on a different page, with redirection back to the
main page using the header() function ( as I've learned to do from reading this
list ). This all works well. The inserted data shows up in the table, and there
are no surprises when refreshing, etc... I have also implemented some error
checking on the client side using JavaScript, and this is also working well.

What I would like to do is somehow have a redundant error check on the server
side and then display an error message above the form on the main page should
fields be left blank or forbidden characters entered. Since I have access to the
$_POST['variables'] on the form processing page, I've already written some code
to detect the presence of error characters, etc...and no query is performed if
there is an error.  But how do I pass a flag variable back to the main page to
echo an appropriate message above the form?

Advice or suggestions greatly appreciated.

David



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



[PHP-DB] PHP - Apache config problem

2003-07-14 Thread dpgirago


Howdy everyone,

I'm in the process of setting up a new development environment with Apache
1.3.27 and PHP 4.3.2 on a Win2k machine with SP2.
I'm getting an error message from apache saying that it can't find the
c:/php/sapi/php4apache.dll . However, that is indeed where the dll is located.

This is the exact line in httpd.conf that apache is choking on:LoadModule
php4_module c:/php/sapi/php4apache.dll .

Funny thing is, I have the same http.conf file in another Win2k machine running
the same apache version but with PHP 4.2.3 , and everything is OK.

Anyone have any ideas?

Thanks in advance.

David



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



Re: [PHP-DB] PHP - Apache config problem

2003-07-14 Thread dpgirago


FYI:

OOPS!!
I dug around in the install.txt file in PHP, and found that php4ts.dll needs to
be relocated to either where apache.exe resides, where
php4apache.dll resides, or in the windows system directory. All now works as
expected.

David





[EMAIL PROTECTED] on 07/14/2003 11:35:42
AM

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

Subject:  [PHP-DB] PHP - Apache config problem





Howdy everyone,

I'm in the process of setting up a new development environment with Apache
1.3.27 and PHP 4.3.2 on a Win2k machine with SP2.
I'm getting an error message from apache saying that it can't find the
c:/php/sapi/php4apache.dll . However, that is indeed where the dll is located.

This is the exact line in httpd.conf that apache is choking on:LoadModule
php4_module c:/php/sapi/php4apache.dll .

Funny thing is, I have the same http.conf file in another Win2k machine running
the same apache version but with PHP 4.2.3 , and everything is OK.

Anyone have any ideas?

Thanks in advance.

David



--
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] PDF Implementation

2003-07-17 Thread dpgirago


Good Morning All ,

Has anyone successfully implemented PDF functionality within their PHP / MySQL
projects?  My needs are very basic, so I'd like to use something like ezPDF
creation to avoid buying a license. But I haven't yet got ezPDF to work
correctly.  Set up is Win2k, PHP 4.3.2, Apache 1.3.24, MySQL 4.0.13.

Specifics are much appreciated.

Thanks,

David



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



[PHP-DB] imagetypes( ) function

2003-07-28 Thread dpgirago


Good day all,

Anyone have an idea why I receive a call to undefined function error message
when I use the imagetypes() function on PHP versions 4.2.3 and 4.3.2 ??

The code to test for  PNG image handling is right from the manual...

?php

if ( imagetypes()  IMG_PNG)
 {
 echo PNG Support enabled;
}

?

David



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



Re: [PHP-DB] imagetypes( ) function

2003-07-28 Thread dpgirago


Ah,

you know, when I removed the semi-colon and restarted apache, I got an error
saying that the module couldn't be found or started...
Wonder why it is not available. I downloaded PHP 4.3.2 php.net just last week.

BTW, I'm on Win 2k, also.

Any ideas?





[EMAIL PROTECTED] on 07/28/2003 11:17:23
AM

To:   [EMAIL PROTECTED]
cc:

Subject:  Re: [PHP-DB] imagetypes( ) function


I'm running php 4.3.0 on windows 2000. The following code woks :

?php
if (imagetypes()  IMG_PNG) {
   echo PNG Support is enabled;
}
?

Producing the following output :

PNG Support is enabled

The manual suggests that the imagetypes() function has been available since
php 4.0.2. But, quoting from the manual This function returns a bit-field
corresponding to the image formats supported by the version of GD linked
into PHP. . Have you enabled the gd2 graphics extension?

Note that in my php.ini configuration file (located in C:\WINNT) I have
enabled the gd2 graphics extension (extension=php_gd2.dll) by removing the
semi-colon from the start of the line, etc.





- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 28, 2003 3:05 PM
Subject: [PHP-DB] imagetypes( ) function




 Good day all,

 Anyone have an idea why I receive a call to undefined function error
message
 when I use the imagetypes() function on PHP versions 4.2.3 and 4.3.2 ??

 The code to test for  PNG image handling is right from the manual...

 ?php

 if ( imagetypes()  IMG_PNG)
  {
  echo PNG Support enabled;
 }

 ?

 David



 --
 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] imagetypes( ) function

2003-07-28 Thread dpgirago


thanks,

I was gonna repost to let everyone know that I was being a dummy because I
hadn't indicated in php.ini where the extensions directory was located. I added
the path, and uncommented the  extension=php_gd2.dll, and all is ok in
php-land. Thanks, again






[EMAIL PROTECTED] on 07/28/2003 03:03:41
PM

To:   [EMAIL PROTECTED], [EMAIL PROTECTED]
cc:

Subject:  Re: [PHP-DB] imagetypes( ) function



php_gd2.dll probably needs to be copied from your php install directory to
your windows system directory (so that it is in the path thingy). On my
system that translated to :

copy c:\php\extensions\php_gd2.dll to c:\WINNT\php_gd2.dll


for more information see,

http://www.php.net/manual/en/install.windows.php

the Installation of Windows extensions section

or the install.txt file in your php directory




- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 28, 2003 5:25 PM
Subject: Re: [PHP-DB] imagetypes( ) function




 Ah,

 you know, when I removed the semi-colon and restarted apache, I got an
error
 saying that the module couldn't be found or started...
 Wonder why it is not available. I downloaded PHP 4.3.2 php.net just last
week.

 BTW, I'm on Win 2k, also.

 Any ideas?





 [EMAIL PROTECTED] on 07/28/2003
11:17:23
 AM

 To:   [EMAIL PROTECTED]
 cc:

 Subject:  Re: [PHP-DB] imagetypes( ) function


 I'm running php 4.3.0 on windows 2000. The following code woks :

 ?php
 if (imagetypes()  IMG_PNG) {
echo PNG Support is enabled;
 }
 ?

 Producing the following output :

 PNG Support is enabled

 The manual suggests that the imagetypes() function has been available
since
 php 4.0.2. But, quoting from the manual This function returns a bit-field
 corresponding to the image formats supported by the version of GD linked
 into PHP. . Have you enabled the gd2 graphics extension?

 Note that in my php.ini configuration file (located in C:\WINNT) I have
 enabled the gd2 graphics extension (extension=php_gd2.dll) by removing the
 semi-colon from the start of the line, etc.





 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, July 28, 2003 3:05 PM
 Subject: [PHP-DB] imagetypes( ) function


 
 
  Good day all,
 
  Anyone have an idea why I receive a call to undefined function error
 message
  when I use the imagetypes() function on PHP versions 4.2.3 and 4.3.2 ??
 
  The code to test for  PNG image handling is right from the manual...
 
  ?php
 
  if ( imagetypes()  IMG_PNG)
   {
   echo PNG Support enabled;
  }
 
  ?
 
  David
 
 
 
  --
  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






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



[PHP-DB] SESSION SID Question

2003-08-28 Thread dpgirago
Howdy Listers, 

Can someone explain to me the mechanism by which SID acquires a value?

For example, 

$FOO = SID;
echo $FOO;

produces something like PHPSESSID=ade4055eef947f1a00cdb280470e859b when 
IE is first opened and the page is loaded,
whereas reloading of the page produces an empty string when $FOO is 
echo'd. Seems to have something to do with creating a 
browser instance.

Thanks,
 
David

[PHP-DB] SESSION SID Question

2003-08-28 Thread dpgirago
Howdy Listers, 

Can someone explain to me the mechanism by which SID acquires a value?

For example, 

$FOO = SID;
echo $FOO;

produces something like PHPSESSID=ade4055eef947f1a00cdb280470e859b when 
IE is first opened and the page is loaded,
whereas reloading of the page produces an empty string when $FOO is 
echo'd. Seems to have something to do with creating a 
browser instance.

Thanks,
 
David

Re: [PHP-DB] Viewing Data From MySQL

2003-09-03 Thread dpgirago
Yes, easily. Use the 'if' conditional in mysql...

select if(col_name = 1, 'yes', 'no') from table_name;

David





Shaun [EMAIL PROTECTED]

09/03/2003 10:32 AM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
[PHP-DB] Viewing Data From MySQL



Hi,

Is it possible to change the way a query is displayed from a MySQL 
database.
For example if I have a column that contains '1' or '0' can I run a query
that returns 'Yes' for every '1' and 'No' for every '0'?

Thanks for your help

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





[PHP-DB] Links within this list

2003-09-18 Thread dpgirago
IMHO I would be extremely reluctant to open any link sent to this list. 
The last time I did so, not only did it connect me to a porno site, it 
created a link in my favorites folder, causing me to have a lot of 
explaining to do ( as I access this list through my place of employment ). 
So, subscribers beware, and participants, think twice about what you 
include in your email.

David






BJ [EMAIL PROTECTED]

09/17/2003 02:41 PM
Please respond to Ben Wheeler; Please respond to Ben Wheeler; Please 
respond to Ben Wheeler; Please respond to BJ; Please respond to BJ


 

To:
[EMAIL PROTECTED]
cc:





Subject:
[PHP-DB] Quick Question  qufcYso



Anyone heard of this company?  I just bought a nice motherboard from these 
guys for 20 bucks!

http://www.tigersurplus.com

Just wanting to know if anyone else has used them before.

Thanks

BJ

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





[PHP-DB] Query Filter in GUI

2003-09-22 Thread dpgirago
Good Morning PHP-DB Listers,

I have a PHP GUI in which a select box gets populated by a query of a 
MySQL DB for all CD's by all artists when the page is first opened. I am 
now trying to implement 
the same query but with a WHERE clause that filters the returned CD's to 
be displayed in the same select box according to the artist selected via a 
group of checkboxes (one per artist).  The problem so far is that if I try 
to implement some flow control (if checbox one is selected, append where 
artist='hendrix' to the select all CDs query, mysql_query() etc...), I get 
an error message saying that the query string is empty. So I am looking 
for some advice about how to implement the logic of having the same select 
box display the results of different but related queries.

For example, 

$query_1 = SELECT CD_title FROM CDs order by CD_title;
$result_1 = mysql_query($query_1) or die(Can't select CD_title from CDs 
. mysql_error());
while($row=mysql_fetch_array($result_1, MYSQL_BOTH)) ..etc...

works just fine.

But if I try to use some flow control to alter which query statement is 
assigned to $query_1...

if(checkbox one is selected)
{
$query_1 = SELECT CD_title FROM CDs WHERE artist_name = 'Hendrix' 
order by CD_title;
}

elseif(no checkboxes are checked)
{ 
$query_1 = SELECT CD_title FROM CDs order by CD_title;
}

$result_1 = mysql_query($query_1) or die(Can't select CD_title from CDs 
. mysql_error());
while($row=mysql_fetch_array($result_1, MYSQL_BOTH)) ..etc...

produces the error message stated above ... that the query string is 
empty. I've also tried to duplicate the mysql_query($query_1) or 
die()... within each section of the IF group, but then the select box 
does not get populated at all.

I am using session variables, and I'm certain that the checkboxes are 
correctly assigning the necessary values to the variables associated with 
them because I am echo'ing the variables and I can see the values that 
they have.

And when I run the query with the where clause in the MySQL client, it 
works just fine.

I'm guessing I'm missing something fairly simple because this type of 
functionality must have been implemented before.

Thanks for reading the rather long question. 

David

[PHP-DB] Query FIlter in GUI

2003-09-22 Thread dpgirago
Thank you CPT John W. Holmes. I'll give it a try.

 David

[PHP-DB] Storing Session Variables

2003-09-24 Thread dpgirago
Just wondering...

Is there a limit to the number of session variables one can create/store ?
Or is the limit imposed by the size of the file ?
I'm on a Windows 2000 machine, and the variables are being saved in 
notepad.

David

Re: [PHP-DB] Storing Session Variables

2003-09-24 Thread dpgirago
Define 'too much' please...

David






CPT John W. Holmes [EMAIL PROTECTED]

09/24/2003 10:29 AM
Please respond to CPT John W. Holmes


 

To:
[EMAIL PROTECTED], [EMAIL PROTECTED]
cc:





Subject:
Re: [PHP-DB] Storing Session Variables



From: [EMAIL PROTECTED]

 Is there a limit to the number of session variables one can create/store 
?
 Or is the limit imposed by the size of the file ?

Size of file is only limit, although you should impose a practical limit
yourself. If you need to ask this question, you're probably relying on
sessions to much.

 I'm on a Windows 2000 machine, and the variables are being saved in
 notepad.

Huh?

---John Holmes...





Re: [PHP-DB] Storing Session Variables

2003-09-24 Thread dpgirago
 Get serious for a second here... Why not explain why you're asking this
 question? If you're going to store a huge amount of data in a session,
 explain why.

OK. Today I'm working on a prototype GUI for a medical setting ( the 
production GUI will be done in C++, I believe). The GUI must keep track of 
a patient's name, prescriptions, and diagnoses, as well as things like 
what treatment room the patient will be seen in. Because different 
treatment rooms have different equipment, and so are used for different 
purposes, the user of the GUI will 
begin by selecting a treatment room, which pulls up from the DB all the 
patients scheduled for that room on that day. There are 6 treatment rooms, 
and if a user has navigated 3 or 4 steps into the GUI then decides to 
select a different treatment room ( and a different patient ), then 
everything gets reset. 

Most of these variables are getting stored as session variables so that 
the data persists as the user navigates further into the application. 
Including things like username, password, permissions, login flag, 
database, hostname, patientID, prescriptionID(s), diagnoses, treatment 
room, and several other variables, I'm using about 15 session variables. 
As I debug, I'm needing to sort through a growing number of variables to 
see what values have been stored in them. This is getting tedious because 
the list scrolls off the page. But as I develop more of the app, the need 
for more persisting variables has grown, and I guess I just had a moment 
of panic that I was gonna hit some limit of persisting variables.

BTW, this GUI is for an intranet site, with perhaps 20 users max. 

You've been extremely helpful to me and many other listers here, John, and 
I did not mean to perturb you in any way by my initial question.


David

Re: [PHP-DB] Query's

2003-09-29 Thread dpgirago
Are you asking for help with the query, or with having the query populate 
a select box? If you are planning to be able to manually enter search 
criteria, then you do not want a select box, you want a text type input. 

David





Andrew R [EMAIL PROTECTED]

09/29/2003 05:01 PM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
[PHP-DB] Query's



Howdy List,

I am a little confused in incorporating a drop down menu into my select
statement.
I have a very simple 1 table database that contains my DVD collection.

Right now - very simply it connects to the database, and then produces
the results of the search based on a

?
  mysql_connect(localhost,name,password); 
  mysql_select_db(oldmovies);
$result = mysql_query (SELECT * FROM movies);

while($r=mysql_fetch_array($result))
  {
$movie_number=$r[movie_number];
$movie_name=$r[movie_name];
$genre=$r[genre];
$star1=$r[star1];
$star2=$r[star2];
$star3=$r[star3];
$director=$r[director];
$brief_synopsis=$r[brief_synopsis];
$imdb_link=$r[imdb_link];


?
This then produces the results onto the page in the tables that I have
formatted.


This was fine when I only had 50 or so dvd's - I am nearing the 500
mark, and it is WAY past time to add a search

This is where I get lost.

I can get into mysql monitor, and I can pull out using SELECT * FROM
movies WHERE genre LIKE ***
And then I have a selection of Genre's that I can enter to generate the
results.

What I am trying to do is incorporate some selection drop down menus
that would make the search process easier.

Example: search for movies where {dropdown1} is {equal or like}
Dropdown 1 would be my first criteria: movie name, director, lead actor,
genre.
The equal or like would be a standard textfield to be filled in.

I hope that I am making sense here. 

If anybody can shed some light onto a confused newbie (the php script
above was written at my old place of employment for me - otherwise I
could ask them) it would be greatly appreciated.

Thank you
Andrew

--

Come to the edge, Life said. 
They said: We are afraid. 
Come to the edge, Life said. 
They came. 
It pushed them...and they FLEW. 
-Guillaume Apollinaire 1870-1918
---
Once you have tasted flight, 
you will walk the earth with your eyes turned skyward, 
for there you have been and there you long to return. 

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





[PHP-DB] How to open PDF File on Server on Local Client

2003-10-14 Thread dpgirago
Good Day All,

I have an intranet GUI that allows users to select, insert, and update 
data in a db.  When data is entered into one of the screens, a C program 
is called which does some calculations and then creates a PDF file on the 
server. I want the user to then see the PDF file opened on their local 
computer (or at least be able to click a link or a button to view it). The 
local machines will use some PDF viewer to open the file (Acrobat or Yap, 
I think). My question is, how do I get PHP to push the file data from the 
server to the client, so that the user can then open the PDF locally. I'd 
like the GUI to remain open so that once the PDF is viewed, printed, and 
closed, the user is back to the GUI.  I think I'm needing a PHP Manual 
reference to some group of functions. Suggestions greatly appreciated.

Thanks,

David

Re: [PHP-DB] How to open PDF File on Server on Local Client

2003-10-14 Thread dpgirago
OK. So if I understand corectly, a link with the path to the file on the 
server will work. How do I have a new browser opened displaying the PDF 
more or less automatically, ie, without the user clicking anything? Is 
this a Header() function?

David

RE: [PHP-DB] How to open PDF File on Server on Local Client

2003-10-14 Thread dpgirago
Richard and Karen,

Thanks for your help this morning with my PDF question. I created the link 
dynamically as you suggested.
In retrospect, I also think that I was seeking a javascript solution, 
i.e., now that the PDF file exists on the web server :

?php

$openPDF =  SCRIPT 
window.open('path_to_PDF_file_on_server');/SCRIPT;

?

Then echo out the variable within the body of the HTML document :

?php

echo $openPDF;

?

David

 just use the target=_blank attribute that I listed in the example in 
the
 previous e-mail. That will spawn a new browser window with the PDF file 
in
 it and leave the original browser window open.

 If you need something more elegant such as a window without the chrome
 (toolbars, address bar, etc.) then you're going to have to use a simple
 JavaScript.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 14, 2003 11:31 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] How to open PDF File on Server on Local Client

 
 OK. So if I understand corectly, a link with the path to the 
 file on the 
 server will work. How do I have a new browser opened 
 displaying the PDF 
 more or less automatically, ie, without the user clicking 
 anything? Is this a Header() function?
 
 David

Re: [PHP-DB] Retreive data from multiple columns by ['tablename.colname']

2003-10-16 Thread dpgirago
Hi Erik,

I think you can use   ** $line['cases.id'] ** if you individually identify each column 
selected, rather than using the * symbol.

David






Erik Björling [EMAIL PROTECTED]

10/16/2003 10:57 AM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
[PHP-DB] Retreive data from multiple columns by ['tablename.colname']



 Hi,

 I use a query with multiple tables:
 SELECT * FROM cases,status,prio  where cases.statusid=status.id  .

 I retreive the data into my variable $line like this.
 while ($line = mysql_fetch_array($result)) {.

 How can I retreive data from $line without using the index value as 
 integers for example $line[13]
 I would like to write $line['cases.id'] to retreive 'id' data from the 
 table 'cases' in a SQL-manner. But I get an error message regarding 
unknown 
 index 'cases.id'.

 Is there an easy solution to this? Is there another sign then '.' or 
should 
 I use other names for my 'id'-columns such as c_id, s_id etc.?
 
 Regards

 Erik Björling

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





[PHP-DB] Extracting values from an array (I think)

2003-11-24 Thread dpgirago
Hello All,

I'm familiar and comfortable with selecting and utilizing one record at a 
time in my php-mysql gui / application. But now I'm faced with having to 
select one field from 24 records and assign the results to 24 different 
variables. 

Table structure: 

CONFIG
+--+--+
| Field  | Type  |
+--+--+
| meter_num | int(11)   |  primary key
| x | double|
| y | double|
| z | double|
| cc_val| varchar(64)   |
| cc_date   | date  |  primary key
| esn   | varchar(64)   |
| dsn   | varchar(64)   |
| csn   | varchar(64)   |
| comm_setup| varchar(128)  |
| multi_port| varchar(16)   |
| threshold | double|
| short_label   | varchar(20)   |
| label | varchar(80)   |
| comments  | varchar(255)  |
| mod_date  | datetime  |
+-+--+--+---+

query =SELECT  short_label  FROM  config  ORDER BY  meter_num;

There will be 24 records max in this table, and meter_num is a primary key 
with values 1- 24 .

If I run this query in the MySQL client, I get a result set like this:

short_label_1
short_label_2
//
//
short_label_24

And I'd like to be able to do this:

$sLabel_1 = short_label_1;
$sLabel_2 = short_label_2;

etc...

These variables / values then get displayed in an HTML table in the 
appropriate place. I know that I can add a where clause to the query to 
select / assign each label individually, but that's 24 queries just for 
this one piece of data. Seems to me there must be a more efficient way to 
do this, but I'm runnin' out of ideas. 

Hope someone is thinking more clearly than I am right now.

Thanks.

David

Re: [PHP-DB] Extracting values from an array (I think)

2003-11-24 Thread dpgirago
Thanks for your kind reply, John. I've not used the variable variable 
technique before but do recall reading about it in the PHP Bible. 

I'll give it a try.

David





John Krewson [EMAIL PROTECTED]

11/24/2003 01:33 PM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
Re: [PHP-DB] Extracting values from an array (I think)



If you have to assign 24 unique variables rather than storing this data 
in an array, then you could apply some variable variable action.  Here 
is a code sample that assumes you are looping through a result set from 
a database:

query =SELECT  short_label  FROM  config  ORDER BY  meter_num;
$result= @MSSQL_QUERY($query)
 or die(Can't connect or something painfully obscure);
while($row = mysql_fetch_assoc($result)) 
{
 ${$short_label}=$row[short_label];
}

That will, I believe, give you a list of variables/values such as:
$short_label_1 = short_label_1
$short_label_2 = short_label_2

You can also adjust the variable name to your liking, such as:

${$short_label._counterPerhaps}=$row[short_label];

The above should be correct, but I do admit that I don't use this 
technique daily.

To bad you cannot just throw your values into an associative array and 
pluck them when needed
using $key = $value type of combinations.




-John

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





Re: [PHP-DB] Extracting values from an array (I think)

2003-11-24 Thread dpgirago
I'm getting the correct output from the following query:


  $selectLabelQuery = SELECT   short_label
 FROM config
 ORDER BY  meter_num;

  $resultSelectLabelQuery = mysql_query($selectLabelQuery) or
 die(can't select short label);


which is processed here:


  $counter = 1;
  while($row=mysql_fetch_assoc($resultSelectLabelQuery))
  {


But the variable variable thing does not seem to be working, either with 
or without the $ for the 'counter' inside the brackets. 


${$sLabel_ . $counter} = $row['short_label'];
$counter++;
  }

When I WATCH  $counter and $row['short_label'], their values are 1 through 
24, and short_label_1 through short_label_24, respectively, so the problem 
is in this part ... ${$sLabel_ . $counter} or even when like this ${$sLabel_ . 
counter}  .

TIA,

David

[PHP-DB] Seeking Opinions about PHP Directory Organization and Permissions on Linux

2004-01-09 Thread dpgirago
Howdy all,

I have been using PHP, MySQL and Apache on Win2K for about a year now and 
have recently begun the process of switching development to Linux -- 
RH9.0.
Yesterday (by using the excellent reference by Patrick Harper, 
http://www.internetsecurityguru.com/documents/snort_acid_rh9.pdf ) I 
finally successfully installed from source MySQL-4.0.16, PHP-4.3.4, and 
Apache-2.0.48 on Linux, and a test phpinfo() page worked as expected. 

Now I need to migrate several multi-file (db_connect files, function 
include files, C executables) apps from windows to linux, so I was 
wondering:

1.  How *nix users organize their 'include' and 'session' directories 
(e.g., outside the web root? how deep in the directory structure?).
2.  Whether all files (including C executables) should be owned by root, 
and what permissions should be set. For example, I was logged in as root 
when I made
 the phpinfo() file, so it  _is_ owned by root. Permissions were set 
automatically to 0644. Is this customary? And who/what will own the 
session files as they are created?
 
Perhaps I'm over-thinking these issues, but I've not much experience on 
*nix compared to windows, and it's Friday afternoon in my spot of the 
world. 

Thanks in advance for any suggestions / tips, etc... 

 dave

[PHP-DB] passing a $_POST variable

2004-01-16 Thread dpgirago
Good day all,

This may be easier than I'm imagining...

The question:
When using the header(location: ...) method for inserting or updating some 
 $_POST['variable']'s into a MySQL db (preventing repeat insertions or 
updates when 'refreshing', etc...), is it possible to return a 
$_POST['variable'] from the page that does the insert? I'm imagining that 
I'd have to have a form on the insert page with a hidden field to hold the 
values(s).  But using this line of reasoning, I'm stuck at how the form 
would be submitted. 

Here's a longer description of the issue:
The main page has 24 radio buttons related to computers on a network. When 
the page is initially displayed, none of these are selected. When a button 
is clicked, information about the selected computer, such as location, IP 
address, MAC, user(s), date of purchase, manufacturer, software installed, 
time and date of update, etc..., is displayed in one column, and in a 
second column, one has the option to enter new values for these items. So 
a user updates the record for the computer, enters username and password, 
hits submit, and the data gets sent in the $_POST array to a second page 
that does the insert, then redirects back to the main page (I know how to 
do all this stuff). What I'd like is for the main page to display the 
newly updated data for the just selected computer, along with info for the 
user related to the update ( succeeded, failed due to wrong password, 
etc..). 

I know I could use $_SESSION or $_GET variables for this stuff, but I'm 
hoping I can use the $_POST array. 

Thank you for taking the time to read this question, and for any thoughts 
you might have about it. 

David

RE: [PHP-DB] CREATE TABLE problem

2004-01-22 Thread dpgirago
Regarding...

-- $query = CREATE TABLE staff (
-- staffid INT(3) NOT NULL AUTO_INCREMENT UNSIGNED,
-- name VARCHAR(255) NOT NULL,
-- login VARCHAR(10) NOT NULL,
-- password VARCHAR(8) NOT NULL,
-- picaddy VARCHAR(255) NOT NULL,
-- email VARCHAR(255)  NOT NULL,
-- staffbio TEXT NOT NULL,
-- createdate DATE NOT NULL,
-- tagline VARCHAR(255) NOT NULL,
-- PRIMARY KEY(staffid,login) );

The problem with the above create table query is the _placement_ of the 
UNSIGNED keyword.

Rather than: 
 staffid INT(3) NOT NULL AUTO_INCREMENT UNSIGNED,  

try: 
 staffid INT(3) UNSIGNED NOT NULL AUTO_INCREMENT, 

The second worked for me while the first threw the previously reported SQL 
Syntax error. 


HTH,
David

[PHP-DB] Unexpected Session Behavior on Mozilla

2004-01-28 Thread dpgirago
Hello PHP-DB listers,

I've a  PHP, MySQL Web Page script that branches according to browser 
(e.g., MSIE, or Mozilla ) and which uses a small number of session 
variables. I've noticed that when connecting through Explorer, for each 
browser / page instance opened on the same machine, there is a new session 
file created ( as I would expect ).  Yet when connecting through Mozilla 
on RH9, there is only one session file created per machine, which causes a 
second instance of the page to inherit the values of the session variables 
from the previously opened page. This is confusing to me, to say the 
least. Anybody have any thoughts as to why this is occurring?

MySQL 4.0.16
PHP 4.3.4
Apache 2.0.48
Win2K IE 5.50x
RH9 Mozilla 1.2.1

Dave

Re: [PHP-DB] Associated popup menu (php/mysql)

2004-02-06 Thread dpgirago
Let's see if I'm understanding you correctly. You want to have a form with 
2 or more popup menus, where a choice of `country` in the first menu then 
populates a second popup menu with the `states` located in that country? 

If this is what you're asking, I do this all the time using select (or 
drop down) boxes in html (with PHP, JavaScript, and a MySQL back-end). 
Perhaps it can be used also for pop-ups...?

The basics are to have the form submit to itself, have the database query 
selecting all `countries` populate the first menu when the page is first 
displayed by running a select id_country, country from Countries query 
against your database, then use the id_country of the selected country to 
run a second query, select state_names from states where id_country = 
{$_POST['value_returned_from_first_query']}. I usually use 
'onchange=\this.form.submit()\' to automate the submittal of the 
form/page.
 
Use conditional statements in your PHP code to control which queries get 
run, that is, only run the second query if the variable for the selected 
country has a value in it.

The PHP manual has lots of examples about how to use built-in functions 
for a variety of databases to query and retrieve data.

HTH,

dave


Hello all,

I've been searching for hours and cannot find the answer or sample in in 
any
forum.

What is the best method (any sample or help would be appreciated), to
associate popup menus in a form. Choosing the first popup menu (Main
categorie) should provide to me the results for the second popup menu
(subcategory).

Ie : Countries -- states

I know that javascript can do this sort of things, but I would like to 
use
only php. Is that possible ?

I have two tables in mysql: Countries  states that can be associated by
id_country.

[PHP-DB] mail() and sendmail configuration

2004-02-23 Thread dpgirago
Good Morning,

This post is somewhat OT -- please forgive me. I've spent over 3 days 
trying to get sendmail configured and I've lost some patience and 
reasoning ability in the process.

I have a Linux (RH9), Apache 2.0.48, PHP 4.3.4, MySQL GUI that creates a 
PDF document on the server for web access. We would also like to have the 
document emailed to several folks within the company. So I essentially 
have to get the PDF attached to an email and routed to our SMTP server. I 
have webmin installed and have tried to use it to configure sendmail. When 
I execute  /etc/rc.d/init.d/sendmail status  ---  Linux says that sendmail 
is running. 

I'm using this method for creating emails with attachments (which was 
posted on the PHP-WIN list several months ago ), but it is failing:

?php 
$fileatt = ; // Path to the file 
$fileatt_type = application/octet-stream; // File Type 
$fileatt_name = ; // Filename that will be used for the file as the 
attachment 

$email_from = ; // Who the email is from 
$email_subject = ; // The Subject of the email 
$email_txt = ; // Message that the email has in it 

$email_to = ; // Who the email is too 
$headers = From: .$email_from; 

$file = fopen($fileatt,'rb'); 
$data = fread($file,filesize($fileatt)); 
fclose($file); 

$semi_rand = md5(time()); 
$mime_boundary = ==Multipart_Boundary_x{$semi_rand}x; 
 
$headers .= \nMIME-Version: 1.0\n . 
Content-Type: multipart/mixed;\n . 
 boundary=\{$mime_boundary}\; 

$email_message .= This is a multi-part message in MIME format.\n\n . 
--{$mime_boundary}\n . 
Content-Type:text/html; charset=\iso-8859-1\\n . 
   Content-Transfer-Encoding: 7bit\n\n . 
$email_txt . \n\n; 

$data = chunk_split(base64_encode($data)); 

$email_message .= --{$mime_boundary}\n . 
  Content-Type: {$fileatt_type};\n . 
   name=\{$fileatt_name}\\n . 
  //Content-Disposition: attachment;\n . 
  // filename=\{$fileatt_name}\\n . 
  Content-Transfer-Encoding: base64\n\n . 
 $data . \n\n . 
  --{$mime_boundary}--\n; 

$ok = @mail($email_to, $email_subject, $email_message, $headers); 

if($ok) { 
echo font face=verdana size=2The file was successfully sent!/font;

} else { 
die(Sorry but the email could not be sent. Please go back and try
again!); 
} 
?

I've examined the content of the variables in this expression (from above) 
[[$ok = @mail($email_to, $email_subject, $email_message, $headers) ]] and 
it looks ok, though I'm no expert, so I'm guessing that the problem lies 
within the sendmail configuration. Webmin has loads of config pages for 
sendmail, and I admit that they're overwhelming right now. It seemed to me 
at first a relatively simple task to have an email created on the server, 
and forwarded to our SMTP server for delivery, but I was obviously naiive 
in this assumption. If anyone has suggestions or knows of helpful links or 
tutorials, I'd be deeply obliged.

Thanks for reading this long post.

David

Re: [PHP-DB] mail() and sendmail configuration

2004-02-23 Thread dpgirago
Jason,

Thanks for the suggestions.

In regard to your question, no. A simple mail() invocation without the 
attachment does not work, hence my sense that the problem is the sendmail 
config.
I'm in the process of checking the logs and will repost if anything looks 
promising.

David





Jason Wong [EMAIL PROTECTED]

02/23/2004 11:10 AM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
Re: [PHP-DB] mail() and sendmail configuration



On Tuesday 24 February 2004 00:18, [EMAIL PROTECTED] wrote:

 This post is somewhat OT -- please forgive me. I've spent over 3 days
 trying to get sendmail configured and I've lost some patience and
 reasoning ability in the process.

 I have a Linux (RH9), Apache 2.0.48, PHP 4.3.4, MySQL GUI that creates a

[snip]

 If anyone has suggestions or knows of helpful links or
 tutorials, I'd be deeply obliged.

0) Does the simplest mail() invocation work at all?

1) Check the php logs
2) Check the sendmail logs
3) Ask on the RedHat list
4) Ask on the sendmail list

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
To craunch a marmoset.
 -- Pedro Carolino, English as She is 
Spoke
*/

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





[PHP-DB] Automatically Refreshing png-Image'd Web Page

2004-03-19 Thread dpgirago
Howdy Listers,

The Background:
I am making dynamic, color-coded, png images of the floor plan of a 
building and displaying them in a browser.  Numerous radioactivity sensors 
throughout the building send their readings to a MySQL dB, and the web 
page queries the dB, and depending on the readings, the areas specific to 
the sensors will appear green for normal, yellow for high but acceptable, 
and red for critical.  All this works OK.

The Problem:
Neither the HTML nor JavaScript code I usually use for automatically 
refreshing a page has any effect if the header(Content-type: image/png) 
necessary for displaying the png image is included. If I comment out the 
header() line, the page refreshes, but the image data comes through as 
hieroglyphics.  Obviously, I need to refresh the page to get the latest 
data, and to create and display the corresponding image.

The Question:
Is there any way to automatically refresh a web page displaying a png 
image?

Thanks in advance for any thoughts/insights into how I can solve this 
problem.

dave

RE: [PHP-DB] Automatically Refreshing png-Image'd Web Page

2004-03-19 Thread dpgirago
Thanks, Paul, you got it right. I was trying to do it all in one 
file/page. I'll have a go at your suggestion.

dave
 
 I might be reading this wrong, but I do not think you should put your
 meta refresh request in the png creation script.  It should be in the
 html body script.

 Index.php
 
 Meta-refresh to call itself in 30 secs
 Call to img src=php_radio_image_creation_script.php


 php_radio_image_creation_script.php
 
 header(Content-type: image/png) 
 Echo image content

 -Paul

RE: [PHP-DB] question on select

2004-05-12 Thread dpgirago
 Thanks so much but I am so new to all this so need more explanation 
please.
 I think at this point I don't mind the round trip to the server side 
till I
 find a better way. But for now I think I have what you are suggesting 
but
 then why my echo is not retuning anything :
 form name=fcountry method=post action=$PHP_SELF
?php 
require(country_build.php);?
input type=text 
name=newcountry value=
?php echo 
$_POST['newcountry'];?
/form


Well, there is no value assgined to $_POST['newcountry'] in your example. 
How are you getting a value to that form field?

dave

Re: [PHP-DB] Re: inserting data into database!

2004-05-14 Thread dpgirago
 Here is my code now, but I am getting a parsing error

 Parse error: parse error, unexpected $end

 $db_table = 'log';

 $conn = mysql_connect($db_host,$db_user,$db_pass);

 if ($conn == true) {

 $insert = INSERT INTO $db_table SET ;

 $insert .= Base = ' . $row-Base . ', ;

 $insert .= Date_and_Time = ' . $row-Date_and_Time . ', ;

 $insert .= Event_Type = ' . $row-Event_Type . ', ;

 $insert .= Description = ' . $row-Description . ', ;

  $insert .= Initials = ' . $row-Initials . ';

 mysql_query($insert, $conn);

?

If this is the actual code, you are missing a closing brace at the end of 
the block.

dave


[PHP-DB] Convert HTML Table to Tab Delimited .TXT file

2004-05-24 Thread dpgirago
Howdy All,

I've PHP / Apache / MySQL running on a Linux machine where a GUI allows an 
administrator to track changes made to computers on our intranet. I've 
been asked to add an 'history' button so that all changes made to one or 
more computers can be put into a table, displayed on client machines 
(windows), then imported into an excel spread sheet.  So far so good. I'm 
querying the dB, retrieving the requested records, then displaying in a 
new window in a table with border set to '0'. The expectation is that the 
admin on a client machine will then copy the table to a text file, then 
import into excel. 

The problem is with the field separator. I tried concatenating a '\t' to 
each field but this didn't behave as expected. Eventually, I concated a 
'|' (bar) character, and this imported with the correct formatting. 
However, now there is this foreign character at the end of  each cell in 
the spread sheet. 

My question is whether there might be a more direct way to get the dB data 
into excel on the client PC (can't imagine how), or if not, how I might 
create a 'tab delimited' file from the HTML table and avoid introducing a 
foreign character as a field separator.

Thanks for reading this long post.

dave 

Re: [PHP-DB] Re: Convert HTML Table to Tab Delimited .TXT file

2004-05-24 Thread dpgirago
Thanks for responding, Torsten. If I'm understanding your suggestion, then 
what happens where the data from the dB already has a ; (semi-colon) in 
it? Wouldn't this corrupt the import into excel? 

dave

 My question is whether there might be a more direct way to get the dB 
data
 into excel on the client PC (can't imagine how), or if not, how I might
 create a 'tab delimited' file from the HTML table and avoid introducing 
a
 foreign character as a field separator.

 A comma seperated values file (.csv) should be readable by Excel. Just 
put a
 ; between all values and save it as a text file with .csv extension. I 
think
 you don't need to go all the way via HTML output and copy/paste.

 Regards, Torsten Roehr

Re: [PHP-DB] Re: Convert HTML Table to Tab Delimited .TXT file

2004-05-24 Thread dpgirago
There definitely are colons, and there is a 'comments' field and 
semi-colons may appear there. However I think I will include a note in the 
help file for the admin to avoid using semi-colons in this field. Seems 
the best solution. And you are right: A .csv is seen as an excel file, so 
opening the audit window then going to file  save as, and making the file 
Audit.csv, or something, avoids having to use the import wizard in excel. 
Saves several steps. Thanks so much! 

dave

 Thanks for responding, Torsten. If I'm understanding your suggestion, 
then
 what happens where the data from the dB already has a ; (semi-colon) in
 it? Wouldn't this corrupt the import into excel?

 This might cause a problem because Excel will start a new row then - 
this
 could also happen with a tab delimiter. At the moment I can't think of a
 solution for this. Is it probable that your data contains semicolons?

 Regards, Torsten

Re: [PHP-DB] Re: Convert HTML Table to Tab Delimited .TXT file

2004-05-24 Thread dpgirago
Thanks, Christian, and all who responded. I think this is almost exactly 
as it will work. The problem with using some kind of MySQL frontend is 
that this would involve some knowledge of dB's and SQL (can't be certain 
of this), and that it would be additional steps. For example, the GUI 
already allows 1 or more computers to be selected (up to 48, now), and the 
audit history button simply queries the audit_table based upon the same 
selection of computers for all changes made during a specified period. 
Having to create a query for computers 1-7, 11, 15, 16, 24, 31, etc, where 
start date = 'some date' and end date = now() would really be dupliating 
work that the GUI is already doing. 


 An easy way to do it (work around) is to dump it as csv or html.  If 
your
 form can output an html table to the browser to show results then all 
you
 need is to include a short instruction on the html form that has all 
results
 in html table that would say something like Save with your browser's 
'save
 as' button and save it as a HTM file then open it with Excel

 Then the user would easily open an HTML file in XLS and do what ever 
they
 want with it (save as XLS, WK*, etc  It gets more complicated if you
 want to use formulas in the spreadsheet but if its just raw data this 
would
 be a very easy way to accomplish what  you want.  Hope this helps.

 Christian

Re: [PHP-DB] Convert HTML Table to Tab Delimited .TXT file

2004-05-24 Thread dpgirago
Wow, thanks. I'm gonna give this a try right now.

dave

Mark Weinstock at [EMAIL PROTECTED] recently wrote...
 Maybe I'm missing something (quite possible), but you can make the
 work happen autogically by using http headers.

 header(Content-type: application/octet-stream);
 header(Content-Disposition: attachment; filename=excelfile.xls);

 Replace excelfile.xls with whatever you want the filename to be

 Then write out your table as you would normally. the result should be
 an excel file either downloaded or opened in the browser, depending
 on the browser settings.

Re: [PHP-DB] Convert HTML Table to Tab Delimited .TXT file

2004-05-24 Thread dpgirago
I've used the header function before for redirection with success, but in 
the current situation I'm not sure where to put the 2 calls to it. I'm 
making the web page on the fly -- querying the dB, writing out the string 
including html tags and the query result, using fopen to create the file, 
then using Javascipt to open a browser window displaying the just created 
page. So far I've either gotten the 'can't send headers, output already 
started' error message, or I've gotten the GUI page itself opened up in 
excel, interesting effect but not the intention ;-)

Does anyone have an idea where to try putting the header calls given the 
above set-up?

Thanks,

dave

 Wow, thanks. I'm gonna give this a try right now.

 dave

 Mark Weinstock at [EMAIL PROTECTED] recently wrote...
 Maybe I'm missing something (quite possible), but you can make the
 work happen autogically by using http headers.

 header(Content-type: application/octet-stream);
 header(Content-Disposition: attachment; filename=excelfile.xls);

 Replace excelfile.xls with whatever you want the filename to be

 Then write out your table as you would normally. the result should be
 an excel file either downloaded or opened in the browser, depending
 on the browser settings.David

[PHP-DB] MySQL_unbuffered_query() and MySQL_free_result()

2004-06-30 Thread dpgirago
Howdy All,

If one were to use mysql_unbuffered_query() instead of mysql_query(), are 
calls to mysql_free_result still needed? or valid? I'm asking because when 
I make this change in one of my scripts, mysql_free_result throws a 
warning: 'xxx'  is not a valid result resource... The application still 
runs fine, however. 

The manual says: 
mysql_unbuffered_query() sends a SQL query query to MySQL, without fetching and 
buffering the result rows automatically, 
as mysql_query() does. 

Does this mean that from PHP's perspective, there only is an identifiable 
result resource when the result set is buffered? Because the rows of data 
are still being sent to PHP, albeit, one row at a time, right? But this 
apparently does not constitute a result resource. 

Can anyone enlighten me?

Thanks,

dave

Re: [PHP-DB] [slightly OT] OOP syntax

2004-06-30 Thread dpgirago
Jeff,

From my recent readings, and others please correct me here, I think you 
need to first declare the variables inside the Class, i.e., var 
$srvr['etime'] = array(); 
var $srvr['etime']['server'];

-- then assign a value to them:

var $srvr['etime']['server'] = '27.22.1.5:1433';

In other words, these must be separate steps. 

Not too sure about the syntax for declaring an array in the above. Maybe 
this needs to be separate steps, too?

HTH,

dave


 I have some procedural code that i'm wanting to convert into classes(and
 i'm a bit greeen to OOP), hopefully to offer them to the PHP community. 
I
 keep all my config data in arrays of arrays, which i'd like to keep when 
i
 move to a class model, but can't seem to find out the correct defintion
 syntax.

 for example, here is a portion of the array storing connection info to a
 mssql db(keeping it in db land)
 $srvr['etime'] = array();
 $srvr['etime']['server']= '27.22.1.5:1433';
 $srvr['etime']['db']  = 'dbmaster';
 $srvr['etime']['user']  = 'uname';
 $srvr['etime']['pass']  = 'pword';
 $srvr['etime']['title']   = 'eTime';
 $srvr['etime']['dfltch']= 'N';
 $srvr['etime']['optional']  = false;

 How would this need to be defined at the top of a class to taken on as a
 class variable/array.  Am i thinking of this wrong?

 I can add them all as scalar variables, but i'd rather work with arrays, 
as
 i use the arrays to loop for other functions.  I've tried a variety of
 syntaxes, but keep getting parse errors.

 thanks for any info you can provide.
 Jeff

RE: [PHP-DB] Turning off Save Password

2004-07-01 Thread dpgirago
I'd bet I'm in the minority here, but I don't mind at all the occasional, 
OT post. Hell, most of life seems OT, doesn't it?
BTW, your solution provides me with very helpful information. Thanks much.

dave 


 Fixed my own problem.

 Within the tag, you can use autocomplete=off
 To turn off the prompting or the autocompletion of any field. Apologize
 for this off-topic post, but I was searching for a non-javascript
 server-side solution

 I'm trying to turn off the save password function so that I can do an
 auth page that refuses to save passwords on the client side. I've tried
 some JS but it works only in IE, not Netscape. So, I'm looking for a
 server-side solution to this.

 Any ideas?

 Gary Every
 Sr. UNIX Administrator
 Ingram Entertainment Inc.
 2 Ingram Blvd, La Vergne, TN 37089
 Pay It Forward!

[PHP-DB] PHP-4.3.7 and OpenSSL Version

2004-07-07 Thread dpgirago
OT
If anyone 'listening' has the php 4.3.7 binary installed on Windows, would 
you kindly run phpinfo() and let me know what version of OpenSSL is 
bundled with the release ( should be either 0.9.7c or 0.9.7d ).
/OT

Thanks,

dave

Re: [PHP-DB] PHP-4.3.7 and OpenSSL Version

2004-07-07 Thread dpgirago
Thanks Marie and MeX for having a look.

dave

Re: [PHP-DB] MySQL software question

2004-07-28 Thread dpgirago
I have ERwin 4.1.2208 installed, and it connects to MySQL only through 
ODBC, so one needs to have the MyODBC.dll installed. You can then make an 
ODBC connection with it. But ERwin is probably a $4,000.00 software 
package. Pretty steep for an individual...

dave 

 May be ERwin or BPwin can help you.
 imho ERwin works with MSSQL, Access, so maybe new versions work with 
 MySQL too.
 Vincent Jordan wrote:

 Is there a piece of software that will allow my to create MySQL
 databases and table relations in a graphical format without having to
 connect to the database?
 
 I am looking for something where I can point and click the creation 
of
 tables and easily create several relationships between tables ( kinda
 like in access ) and when in done it will create the .sql file?

Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread dpgirago
Have you assigned the values in the $_SESSION['l_industry'] array to those 
specific local variables, $l_industry['0'], $l_industry['1']... ?

dave








Stuart Felenstein [EMAIL PROTECTED]

10/11/2004 10:20 AM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
Re: [PHP-DB] Don't mean to be repetitive - Session Variables



I may have spoken too soon.  Having one minor problem
with getting an array (from a multiple select) to
print out.  Anyone see anything wrong here :

Here is registering session array:

if ( empty( $_SESSION['l_industry'] ) ) {
$_SESSION['l_industry']=array();
}

if ( is_array( $_REQUEST['LurkerIndustry'] ) ) {
$_SESSION['l_industry'] = array_unique(
array_merge( $_SESSION['l_industry'],
 $_REQUEST['LurkerIndustry'] )
);
}
Here is my call: 

echo $l_industry['0'].br /; 
echo $l_industry['1'].br /; 
echo $l_industry['2'].br /; 
echo $l_industry['3'].br /; 
echo $l_industry['4'].br /; 
echo $l_industry['5'].br /; 


Thank you,
Stuart

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





Re: [PHP-DB] INNO tables - will I have problems?

2004-10-13 Thread dpgirago
[EMAIL PROTECTED]

10/13/2004 12:11 PM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
Re: [PHP-DB] INNO tables - will I have problems?



To quote the Mighty Gerard Samuel [EMAIL PROTECTED]:

  Julian Madle wrote:
   I obviously have no control of which ISP and end-user may
   choose, although our product will specify that Linux, PHP4, and 
MySQL4 (or
   higher) are installed. The manual says that these are built-in on 
version
   4.0 and above - I just need real-world confirmation from people with 
more
   experience in this area than me.
  
 
  If the minimum requirement of mysql is version 4, then you
  will have no problems, as INNODB is the default type in mysql 4.x.x
 
  --

 InnoDB is included by default in mysql 4 but the default is still MyISM.

make that MyISAM

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





Re: [PHP-DB] INNO tables - will I have problems?

2004-10-13 Thread dpgirago
right, so after you define the fields of the table,  you add type=innodb
simple as that

dave






Gerard Samuel [EMAIL PROTECTED]

10/13/2004 02:34 PM



 

To:
[EMAIL PROTECTED]
cc:
[EMAIL PROTECTED], [EMAIL PROTECTED]




Subject:
Re: [PHP-DB] INNO tables - will I have problems?



[EMAIL PROTECTED] wrote:
If the minimum requirement of mysql is version 4, then you
will have no problems, as INNODB is the default type in mysql 4.x.x

--
 
 
 InnoDB is included by default in mysql 4 but the default is still MyISM.
 

I looked over the manual, and I believe that you are correct.
The default type is still MyISAM, but to create an INNODB table, one
must specify it in the CREATE TABLE syntax...

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





Re: [PHP-DB] setting root password

2004-10-18 Thread dpgirago
If you haven't yet deleted the localhost root account, you can log onto 
the mysql client with:
mysql mysql -uroot -p

then press enter again when it prompts you for a password.

You should now be able to manage all your account info.

dave






Perry, Matthew (Fire Marshal's Office) [EMAIL PROTECTED]

10/18/2004 01:28 PM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
[PHP-DB] setting root password



I have tried the step-by-step methods listed on mysql.com for setting a 
root
password for my local server but I keep getting the message you must have
privileges to update tables in the mysql database to be able to change
passwords for others.   What could I be doing incorrectly?

-Matt





RE: [PHP-DB] setting root password

2004-10-19 Thread dpgirago
Matt,

Is there a space between PASSWORD and the opening parenthesis? There 
shouldn't be, if there is. Otherwise, your statement worked without errors 
for me on MySQL Version 4.0.16.max-nt.

Make sure that you are logged in as root. 

C : \ select user();

Sometimes MySQL is cryptic about its error messages for security reasons.

dave






Perry, Matthew (Fire Marshal's Office) [EMAIL PROTECTED]

10/19/2004 08:24 AM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
RE: [PHP-DB] setting root password



 

After going to the command prompt I have done exactly this:

 

c:\cd C:\mysql\bin

c:\mysql\binmysql -uroot -p

mysqlSET PASSWORD FOR [EMAIL PROTECTED]('mypassword');

 

I get the following familiar message:

 

You have an error on your SQL syntax.  Check the manual that corresponds 
to
your MySQL server version for the right syntax to use near
'PASSWORD('mypassword')' at line 1

 

Why does this not set my password correctly?

 

-Matt

 

  _ 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 18, 2004 1:35 PM
To: [EMAIL PROTECTED]; Perry, Matthew (Fire Marshal's Office)
Subject: Re: [PHP-DB] setting root password

 


If you haven't yet deleted the localhost root account, you can log onto 
the
mysql client with: 
mysql mysql -uroot -p 

then press enter again when it prompts you for a password. 

You should now be able to manage all your account info. 

dave 





 


Perry, Matthew (Fire Marshal's Office) [EMAIL PROTECTED] 


 


10/18/2004 01:28 PM 


 


 

 


To: 

[EMAIL PROTECTED] 


cc: 

 


 

 


 

 


Subject: 

[PHP-DB] setting root password




I have tried the step-by-step methods listed on mysql.com for setting a 
root
password for my local server but I keep getting the message you must have
privileges to update tables in the mysql database to be able to change
passwords for others.   What could I be doing incorrectly?

-Matt








RE: [PHP-DB] How to send a SID in a security way - SOLVED!!!

2004-10-22 Thread dpgirago
Andre,
Did you intend to write that both sessions have the same name? Doesn't 
that result in the same issue with the session identification?
dave





Andre Matos [EMAIL PROTECTED]

10/22/2004 03:25 PM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
RE: [PHP-DB] How to send a SID in a security way - SOLVED!!!



Hi list,

Thanks for all people who tried to help me in my session problem.

I have found a simple and easy way to have to web-based php applications
running in the same server and having one user using both on the same web
browser (two different windows or tabs).

I did this in one system:

session_name(System1);
session_start();


and this in the another system:

session_name(System1);
session_start();


Now I can have my two applications running in the same browser at the same
time.

Thanks for all help that I received!!!

Andre

--
Andre Matos
[EMAIL PROTECTED] 

-Original Message-
From: Andre Matos [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 22, 2004 12:59 PM
To: 'Matt M.'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] How to send a SID in a security way

Hi Matt,

I am trying to solve my problem to have one browser accessing two 
different
applications (each one in a different window) where each application has 
its
own and unique sessionID. I really don't want to use cookie because I will
need that the user enable the option accept cookies in the browser.

However, I am afraid to pass the sessionID on the URL because someone can
cat it.

I am using currently using SSL.

Can you see any solution for my problem?

Thanks.

--
Andre Matos
[EMAIL PROTECTED] 

-Original Message-
From: Matt M. [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 22, 2004 12:35 PM
To: Andre Matos
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] How to send a SID in a security way

 How can I send a SID (SessionID) in a security way from one page to
another?
 Is it security to do this?

not sure what exactly you want.  You could just use cookies, dont
allow it to be in form fields or query strings.

you could use ssl.

-- 
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] How to send a SID in a security way - SOLVED!!!

2004-10-25 Thread dpgirago
Just wanted to clarify. 

The devil is always in the details. 

dave

***
---
Bart Baaten [EMAIL PROTECTED] wrote on 10/22/2004 03:35 PM

I think he meant one was named System1 and the other System2.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: vrijdag 22 oktober 2004 22:34
To: Andre Matos
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] How to send a SID in a security way - SOLVED!!!

Andre,
Did you intend to write that both sessions have the same name? Doesn't 
that result in the same issue with the session identification?
dave

Andre Matos [EMAIL PROTECTED]
10/22/2004 03:25 PM

To:
[EMAIL PROTECTED]
cc:

Hi list,

Thanks for all people who tried to help me in my session problem.

I have found a simple and easy way to have to web-based php applications
running in the same server and having one user using both on the same web
browser (two different windows or tabs).

I did this in one system:

session_name(System1);
session_start();


and this in the another system:

session_name(System1);
session_start();


Now I can have my two applications running in the same browser at the same
time.

Thanks for all help that I received!!!

Andre

--
Andre Matos
[EMAIL PROTECTED] 

-Original Message-
From: Andre Matos [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 22, 2004 12:59 PM
To: 'Matt M.'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] How to send a SID in a security way

Hi Matt,

I am trying to solve my problem to have one browser accessing two 
different
applications (each one in a different window) where each application has 
its
own and unique sessionID. I really don't want to use cookie because I will
need that the user enable the option accept cookies in the browser.

However, I am afraid to pass the sessionID on the URL because someone can
cat it.

I am using currently using SSL.

Can you see any solution for my problem?

Thanks.

--
Andre Matos
[EMAIL PROTECTED] 

-Original Message-
From: Matt M. [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 22, 2004 12:35 PM
To: Andre Matos
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] How to send a SID in a security way

 How can I send a SID (SessionID) in a security way from one page to
another?
 Is it security to do this?

not sure what exactly you want.  You could just use cookies, dont
allow it to be in form fields or query strings.

you could use ssl.


RE: [PHP-DB] backing up database with mysqldump

2004-10-25 Thread dpgirago
C:\mysqldump -uadministrator -p  test  test.sql
Enter password: **






Perry, Matthew (Fire Marshal's Office) [EMAIL PROTECTED]

10/25/2004 01:53 PM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
RE: [PHP-DB] backing up database with mysqldump



 

How do I provide a password?

I have been trying -p password[mypass] mysqldump sampledb 
./backup/file.txt

-Matt

 

  _ 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 25, 2004 11:24 AM
To: Perry, Matthew (Fire Marshal's Office)
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] backing up database with mysqldump

 


MySQLdump is an executable program. 
From the command line: 

C:\mysqldump databasename  ./path/to/backup/file.sql (or file.txt ) 

C:\mysqldump --help 

gives all the options 

dave 




 


Perry, Matthew (Fire Marshal's Office) [EMAIL PROTECTED] 


 


10/25/2004 11:14 AM 


 


 

 


To: 

[EMAIL PROTECTED] 


cc: 

 


 

 


 

 


Subject: 

[PHP-DB] backing up database with mysqldump




I have attempted to follow the documentation for mysqldump both on 
mysql.com
and previous emails to this list server.  Unfortunately none of the advice
has helped me successfully backup my database.  I have been spoiled by
phpmyadmin backup procedures and have never had to manually set up a 
backup
system for a local server.

From shell what should I enter tot to backup my database called sampdb 
to
a location c:/backups?

Everything I have tried spits out an error message.

-Matt








RE: [PHP-DB] Book recommendation for using MySQL w. PHP

2004-11-05 Thread dpgirago
Rene,

I've gotten a lot of mileage lately out of 'The PHP Anthology,  Volumes I 
and II' by Harry Fuecks and published by SitePoint. The author 
demonstrates IMO fairly sophisticated usage of OOP techniques in 
constructing classes for MySQL, in particular.  And the coding examples 
are robust and explained really well. 

As to using MySQL and building queries, Paul DuBois' MySQL, Second Edition 
has stood the test of time for me as a basic and advanced reference. 

dave

RE: [PHP-DB] how to find

2004-11-11 Thread dpgirago
Martin, 

Thanks for your kind words to the new guy. I really don't understand why 
others don't simply refrain from responding rather than burn bandwidth 
with their rants of RTFM or or Off Topic - go somewhere else. I really 
appreciate all the posts folks make as I tend to learn something, even if 
the content is unexpected. 

 I think (hope) that Rene was just trying to emphasize that while this is
 a php mailing list - it is focused on databases.  An array full of 0's
 and 1's - while certainly data - hardly constitutes that.
 
snip

David Giragosian, Psy.D.
Database Developer and Programmer
MD Anderson Cancer Center
Houston, Texas
713-792-7898

RE: [PHP-DB] mysql db dump with php

2004-11-17 Thread dpgirago
Nate,

Don't know if this is the case or not, but the destination database has to 
already exist on the upload server.

dave






Nate Nielsen [EMAIL PROTECTED]

11/17/2004 10:08 AM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
RE: [PHP-DB] mysql db dump with php



I tried this but to no avail.  What I surmise is that one of the following
is holding this up from being an option.

1) I'm on a shared server so I will have to specify the location of the 
file
to save in order to get to it afterwards.  I tried specifying the path and
the file name in the examples below but didn't get the resulting file as I
expected.

2) Its possible that the web server does not have the command available as
the mysql server is on another box, thus I won't be able to execute it.  I
am not familiar with mysql, so I'm not sure if this could be the case, is 
it
possible to have the drivers and not the supporting utilities installed?

3) Somehow shell execution is not enabled (exec()).  I do not think this 
is
the case as I am not thrown an error.  It would be possible though I would
think that the php script process doesn't have access to execute that
process maybe?

Any suggestions or another method? 

Thanks a ton!

Nate 
[EMAIL PROTECTED]


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 17, 2004 12:11 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] mysql db dump with php

On Wednesday 17 November 2004 13:51, Nate Nielsen wrote:

 i need a script that will connect to a db with a username and password,
and
 then export to the screen scripts to both recreate the database 
structure
 (the create table commands) and then create insert statements to 
populate
 that information into the database.  then of course, i need to run those
 scripts on the other server to create the db and populate it.

From the command line of the system holding source database:

  mysqldump --opt -u username -p password nameofdatabase 
nameofdatabase.sql

Now take the created file nameofdatabase.sql and place onto the system
holding 
destination database. Then from the command line of the system holding 
destination database:

  mysql -u username -p password  nameofdatabase.sql

If you don't have direct access to the command line use php's program 
execution functions.

 if you can hook me up i'll paypal you $20 bucks to buy you and yours a 
few
 pints of your favorite ale on me.

Donate it to your local Red Cross/Red Crescent or equivalent.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Logoff in progress...
*/

-- 
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] Transaction suddenly not working

2004-11-29 Thread dpgirago
 --- Ford, Mike [EMAIL PROTECTED] wrote:

   0: INSERT INTO Table1 (LurkID, ProfileName, Edu,
   WorkAuth, WorkExp, CarLev, Secu, Confi, Relo,
   Telecomu, City1, State1, City2, State2,
  TravelPref,
   SalaryAnnual, SalaryHourly, Available) VALUES (47,
   '', 7, 2, 1015, 5, , '', '', '', 'fds', 5,
  '',
  
  You have 2 successive commas in this last line, with
  no value in between --
  this is your syntax error.
  
   , 4, 26, , 2004-02-02)01062 : Duplicate entry
   '0-f' for key 1
  
  And again on this line -- twice, in fact, since the
  previous line ends with
  a comma, too.
 

 Mike are you saying that I should put single quotes
 around all values regardless of the type ?
 The double commas are happening because around an int
 I don't use 'value' the single quotes . ?

Don't know about other database engines, but in MySQL, it doesn't matter 
if an int is inserted as a string, i.e., with the quotes. My recollection 
is that MySQL handles the type conversion internally. So, assuming you are 
validating the entries before inserting, if a value is missing, assign to 
it ''. Whatever the field has as a default value will then be inserted 
into the table.

dave 

Re: [PHP-DB] Use of 'as' name in where sub-clause

2004-12-01 Thread dpgirago
Ross, 

 If someone can give me a good reason why this is so, it will stop it 
 annoying me so much.

From the MySQL manual for version 4.0.16:

It is not allowed to use a column alias in a WHERE clause, because the column 
value may not yet be determined when the WHERE clause is executed. See section 
A.5.4 Problems with alias.

I didn't check section A.5.4, but it probably gives a more detailed 
explanation.

dave

Re: [PHP-DB] Insert db values into dropdown box error

2004-12-09 Thread dpgirago
It looks like the parenthesis on the line with the 'while' loop is an 
opening parenthesis instead of a closing parenthesis.

 while($row=mysql_fetch_array($result)({
   ^
dave

[PHP-DB] List Active??

2004-12-29 Thread dpgirago
Just testing the list mail server as I haven't received any posts for days 
now.

dave

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread dpgirago
   Jason, can you explain why stripslashes should not be used on data
 taken from the db? when you store data in the db i thought it was good
 practice to addslashes, when you retrieve from the db, you will need
 to use stripslashes to remove the extra \

If I may step in...

Assuming a MySQL db, using mysql_escape_string obviates the need for using 
either stripslashes or addslashes for db 
inserts and selects. I'm not sure of the underlying mechanism, but if you 
use mysql_escape_string on a string, the  \'s and' s, etc... all get 
escaped automagically 
before the insert. If you then take a look at the inserted data using the 
mysql client, you will see that the full unescaped text has been inserted. 
So there is no need to use stripslashes when selecting it out. 

Personally, this is counterintuitive, but that's the way it works.

David

Re: [PHP-DB] max character size mysql can contain

2005-02-25 Thread dpgirago
Yemi Obembe wondered:

Hi guiz,
I was just wondering if anyone has an idea the maximum size of 
characters(in bytes) a mysql database can contain
thanx

*

This is determined by the OS file-size limit as MyQSL stores its data in 
regular files. I think maybe 4G on windows. Not sure on *nix, but likely 
much bigger.

David

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread dpgirago
 On a side note, who's sick of seeing the word optimizing misspelled in 
 the title? :)

 Ah, the things we do to keep a thread clean.

 -- 
 - Martin Norland, Sys Admin / Database / Web Developer, International 


Well, of course, _optimise_ is the British spelling of _optimize_ .

Afterall, this __is__ an international list ;-

David 

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread dpgirago
 [EMAIL PROTECTED] wrote:
 
   On a side note, who's sick of seeing the word optimizing misspelled 
in
   the title? :)
 
   Ah, the things we do to keep a thread clean.
[snip]
 Well, of course, _optimise_ is the British spelling of _optimize_ .
 
 Afterall, this __is__ an international list ;-
 
 David

 My apologies to all, 'dict' tricked me - it has 'optimize', 'optimise', 
 'optimizing', but not 'optimising' - and I foolishly only checked the 
 -ing conjugated tense instead of the root! (I do try a cursory check 
 before posting such nonesense, honest!)

 Now back to your regularly scheduled international discussion...

Martin,

No apologies necessary from my perspective. You are a very active member 
of these php lists, and you have helped a great many php users the world 
over. I'm afraid some cross cultural sensitization kicked in on my end 
from many years working in human services.

David

RE: [PHP-DB] What wrong with my Query??

2005-03-25 Thread dpgirago
Harry,

I think you could also just use backticks around `limit` as occurs in the 
table creation statement below.

David

 limit is a mysql keyword...change that field name and the corresonding 
names 
 in your sql

 bastien

  From: HarryG [EMAIL PROTECTED]
  To: php-db@lists.php.net
  Subject: [PHP-DB] What wrong with my Query??
  Date: Fri, 25 Mar 2005 16:26:38 +1100
  
  What the hell is wrong with this MYSQL query?? PHP keeps giving me the 

  error message:
 
  You have an error in your SQL syntax. Check the manual that 
corresponds to 
  your MySQL server version for the right syntax to use near 
'limit=2, 
  name='test1', email='[EMAIL PROTECTED]', password='t
 
  $query = INSERT INTO mfadmin SET id='', account='$accname_lc', 
  limit=$plans, name='$yourname', email='$email', password='$password', 
  lastlogin='$datetoday', datecreated='$datetoday', 
expiry='$expirydate', 
  lastip=123.123.123.123;
 
  This is my table structure
  CREATE TABLE `admin` (
`id` int(10) unsigned NOT NULL auto_increment,
`account` varchar(50) NOT NULL default '',
`limit` int(10) unsigned NOT NULL default '0',
`name` varchar(50) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`password` varchar(50) NOT NULL default '',
`lastlogin` varchar(50) NOT NULL default '',
`datecreated` varchar(50) NOT NULL default '',
`expiry` varchar(50) NOT NULL default '',
`lastip` varchar(50) NOT NULL default '',
PRIMARY KEY  (`id`)
  ) TYPE=MyISAM;

RE: [PHP-DB] What wrong with my Query??

2005-03-25 Thread dpgirago
Either syntax is correct. From section 6.4.3 of the MySQL Manual:

INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
VALUES ((expression | DEFAULT),...),(...),...
[ ON DUPLICATE KEY UPDATE col_name=expression, ... ]
or  INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
SELECT ...
or  INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name
SET col_name=(expression | DEFAULT), ...
[ ON DUPLICATE KEY UPDATE col_name=expression, ... ]

David

*
Actually, your sql syntax is wrong. The SET keyword if for UPDATE not
INSERT 

Use 
$sql = INSERT INTO mfadmin
(id,account,planlimit,name,email,password,lastlogin,datecreated,expiry,l
astip) VALUES
('','$accname_lc','$plans','$yourname','$email','$password','$datetoday'
,'$datetoday','$expirydate','123.123.123.123');


Gary Every
Sr. UNIX Administrator
Ingram Entertainment Inc.
2 Ingram Blvd, La Vergne, TN 37089
Pay It Forward!


-Original Message-
From: HarryG [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 24, 2005 11:27 PM
To: php-db@lists.php.net
Subject: [PHP-DB] What wrong with my Query??


What the hell is wrong with this MYSQL query?? PHP keeps giving me the
error message:

You have an error in your SQL syntax. Check the manual that corresponds
to your MySQL server version for the right syntax to use near
'limit=2, name='test1', email='[EMAIL PROTECTED]', password='t 

$query = INSERT INTO mfadmin SET id='', account='$accname_lc',
limit=$plans, name='$yourname', email='$email', password='$password',
lastlogin='$datetoday', datecreated='$datetoday', expiry='$expirydate',
lastip=123.123.123.123;
 
This is my table structure
CREATE TABLE `admin` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `account` varchar(50) NOT NULL default '',
  `limit` int(10) unsigned NOT NULL default '0',
  `name` varchar(50) NOT NULL default '',
  `email` varchar(50) NOT NULL default '',
  `password` varchar(50) NOT NULL default '',
  `lastlogin` varchar(50) NOT NULL default '',
  `datecreated` varchar(50) NOT NULL default '',
  `expiry` varchar(50) NOT NULL default '',
  `lastip` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

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



[PHP-DB] How to Disable Daylight Savings Time on RedHat 9.0

2005-04-05 Thread dpgirago
We have created a MySQL/ C application that gathers environmental data and 
does inserts into the db once per minute. 
A set of PHP applications reads this data and does some graphical display 
of the values. 
Changing from Standard Time to Daylight Savings Time causes minor 
problems, but in the Fall, DST to ST will screw things up royally.

I did some googling yesterday, and others have asked how to disable the 
automatic DST changeover in Red Hat 9.0, but no one really got an answer, 
leading me to believe that it is not straight forward. Does anyone know 
how to do this?? 

Thanks very much,

David

Re: [PHP-DB] Pre-Include File -- Global Include Pre/Post by filename

2005-04-05 Thread dpgirago
Peter,

Perhaps you are referring to these directive in php.ini:

; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =

David






Peter Beckman [EMAIL PROTECTED]

04/05/2005 03:39 PM



 

To:
PHP-DB Mailing List php-db@lists.php.net
cc:





Subject:
[PHP-DB] Pre-Include File -- Global Include Pre/Post by filename



Back in 2000 I remember there being a file that could be created in the
include path that, if existed, would be called and executed before any
other PHP script was executed.  There was also a script that if named
correctly and put in the include path, would execute AFTER the called
script was executed.

Was this depreciated, or does it still exist?  I can't remember what to
call it, and I can't seem to find the right page in the manual.  Any help?

Beckman
---
Peter Beckman  Internet 
Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---

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





Re: [PHP-DB] How to Disable Daylight Savings Time on RedHat 9.0

2005-04-05 Thread dpgirago
 We have created a MySQL/ C application that gathers environmental data and 

 does inserts into the db once per minute. 
 A set of PHP applications reads this data and does some graphical 
display 
 of the values. 
 Changing from Standard Time to Daylight Savings Time causes minor 
 problems, but in the Fall, DST to ST will screw things up royally.

 I did some googling yesterday, and others have asked how to disable the 
 automatic DST changeover in Red Hat 9.0, but no one really got an 
answer, 
 leading me to believe that it is not straight forward. Does anyone know 
 how to do this?? 

Solved.

Turns out this is a multi-step process in Linux involving creating a text 
file with new time zone rules, running it against 'zic' ( as in -- zic 
newRules.tx ), then soft linking the output file to /etc/localtime. 

See this link: 
http://avi.alkalay.net/linux/docs/TimePrecision/TimePrecision.html#tz.linux

about which the author was kind enough to respond, and see 'man zic' for 
more basic info and some additional examples.

-- David 

Re: [PHP-DB] Transfering post data to a series of pages.

2005-05-04 Thread dpgirago
Perry, Matthew (Fire Marshal's Office) wrote:
 Is there a way to transfer post data to a series of PHP pages?
 
 For example, lets say I have the following 4 pages:
 Page1.php - this page has my original post form
 Page2.php - this page does one thing with the post data
 Page3.php - this page does another thing with the post data
 Page4.php - this page shows the results of everything I have done
 
 Right now I am using the header: ?header(Location: page3.php);?
 
 The problem is, the following works:
 Page1.php - this page has my original post form
 Page2.php - this page does one thing with the post data
 Page3.php - this page shows the results of everything I have done
 
 But when I try to add the second transfer the data is lost:
 Page1.php - this page has my original post form
 Page2.php - this page does one thing with the post data
 Page3.php - this page does another thing with the post data
 Page4.php - Only the results from Page2.php are shown
 
 ASP does this with %Server.Transfer (transferpage1.asp)%
 Is there a counterpart with PHP?
 
 - Matthew

Martin Norland wrote:
 include() :P

 seriously though, Page1.php and Page4.php are the only two pages that 
 should exist, if any.  Page2 and Page3 should pretty much guaranteed be 

 turned into function calls or classes and called from Page4.php.  You 
 don't need to separate logic and display in separate scripts that you 
 push everything at, just separate your logic out into function calls.


What Martin suggests makes a lot of sense. Can you say something about why 
you have the site design the way that you do?

David

[PHP-DB] Creating an Associative Array

2005-06-08 Thread dpgirago
This question will probably be off-topic for some, but it does relate to a 
database application so please bear with me. 

I'm pulling date-times out of a MySQL db:

mysql select date_format(`date_time`, '%Y.%m.%d %H:%i:%s') as rightNow 
from location1 order by date_time desc limit 1;

++
| rightNow |
++
| 2005.06.08 14:24:11 |
++
1 row in set (0.00 sec)

then trying to create an associative array where the date-time is the key 
and a value, corresponding to a pixel location on a graph, is computed 
using an algorithm like this:

(int)ceil(980 - ($counter * .2)); (see below)

This code snippet is producing an array of arrays rather than a simple 
associative array:

?php

$now = time();
//$dateArray = array(); (output is the same with or without this line)

for($counter = 0; $counter = 3600; $counter++) 
{
  $dateArray[] = array(date(Y.m.d H:i:s, $now - $counter) = 
(int)ceil(980 - ($counter * .2)));
}

?

output:

array(3601) { [0]= array(1) { [2005.06.08 15:50:17]= int(980) } [1]= 
array(1) 
{ [2005.06.08 15:50:16]= int(980) } [2]= array(1) { [2005.06.08 
15:50:15]= int(980) } [3]= array(1) 
{ [2005.06.08 15:50:14]= int(980) } [4]= array(1) { [2005.06.08 
15:50:13]= int(980) } [5]= array(1) 
{ [2005.06.08 15:50:12]= int(979) } [6]= array(1) { [2005.06.08 
15:50:11]= int(979) } [7]= array(1) ...

What I need is output like this:

array(3601) { [2005.06.08 14:52:56]= int(980)
  [2005.06.08 14:52:55]= int(979)
  [2005.06.08 14:52:54]= int(978)
  [2005.06.08 14:52:53]= int(977) 
  etc
}

so that I can search for a pixel value given a certain time value within 
the past hour.

I hope this makes sense and that someone can see the error in code.

I'm using php 4.3.7, but I see that php 5.x has an array_combine function 
that would do the trick. 
Maybe will have to upgrade.

David
(obviously not ready for the Zend Exam)


[PHP-DB] Re: Subject: Creating an Associative Array

2005-06-09 Thread dpgirago
Thank you kindly, Neil Smith and Brent Baisley.

I now see the error of my approach. 

---
$dateArray = array();

 for($counter = 0; $counter = 3600; $counter++)
 {
$dateArray[ date(Y.m.d H:i:s, $now - $counter) ] = 
 (int)ceil(980 - ($counter * .2)));
 } 
---

works just fine.

note: 
Brent, the array(3601) was coming from the $counter loop above and is the 
seconds in an hour plus one ( for aesthetic reasons ).

David

[PHP-DB] Re: Subject: Creating an Associative Array

2005-06-09 Thread dpgirago
Thank you kindly, Neil Smith and Brent Baisley.

I now see the error of my approach. 

---
$dateArray = array();

 for($counter = 0; $counter = 3600; $counter++)
 {
$dateArray[ date(Y.m.d H:i:s, $now - $counter) ] = 
 (int)ceil(980 - ($counter * .2)));
 } 
---

works just fine.

note: 
Brent, the array(3601) was coming from the $counter loop above and is the 
seconds in an hour plus one ( for aesthetic reasons ).

David


**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


GWAVAsigAdmID:37A922A2575C9B012AB98578DBAB5653



**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


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

[PHP-DB] Re: Subject: Creating an Associative Array

2005-06-09 Thread dpgirago
Thank you kindly, Neil Smith and Brent Baisley.

I now see the error of my approach. 

---
$dateArray = array();

 for($counter = 0; $counter = 3600; $counter++)
 {
$dateArray[ date(Y.m.d H:i:s, $now - $counter) ] = 
 (int)ceil(980 - ($counter * .2)));
 } 
---

works just fine.

note: 
Brent, the array(3601) was coming from the $counter loop above and is the 
seconds in an hour plus one ( for aesthetic reasons ).

David


**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


GWAVAsigAdmID:37A922A2575C9B012AB98578DBAB5653



**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


GWAVAsig
AdmID:9E1A5D45CE9792B6FD38BE4153846A88

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

[PHP-DB] Re: Subject: Creating an Associative Array

2005-06-10 Thread dpgirago
Thank you kindly, Neil Smith and Brent Baisley.

I now see the error of my approach. 

---
$dateArray = array();

 for($counter = 0; $counter = 3600; $counter++)
 {
$dateArray[ date(Y.m.d H:i:s, $now - $counter) ] = 
 (int)ceil(980 - ($counter * .2)));
 } 
---

works just fine.

note: 
Brent, the array(3601) was coming from the $counter loop above and is the 
seconds in an hour plus one ( for aesthetic reasons ).

David


**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


GWAVAsigAdmID:37A922A2575C9B012AB98578DBAB5653



**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


GWAVAsig
AdmID:9E1A5D45CE9792B6FD38BE4153846A88

AdmID:FA8430F7710CE34D77197636E5D0CA4E

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

[PHP-DB] Re: Subject: Creating an Associative Array

2005-06-10 Thread dpgirago
Thank you kindly, Neil Smith and Brent Baisley.

I now see the error of my approach. 

---
$dateArray = array();

 for($counter = 0; $counter = 3600; $counter++)
 {
$dateArray[ date(Y.m.d H:i:s, $now - $counter) ] = 
 (int)ceil(980 - ($counter * .2)));
 } 
---

works just fine.

note: 
Brent, the array(3601) was coming from the $counter loop above and is the 
seconds in an hour plus one ( for aesthetic reasons ).

David


**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


GWAVAsigAdmID:37A922A2575C9B012AB98578DBAB5653



**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


GWAVAsig
AdmID:9E1A5D45CE9792B6FD38BE4153846A88

AdmID:FA8430F7710CE34D77197636E5D0CA4E

AdmID:02BD4969B4A93E3734B33C6E12E58D39

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

Re: [PHP-DB] mysqldump but exclude one table. .

2005-06-14 Thread dpgirago
C:\mysqldump --version
mysqldump  Ver 9.09 Distrib 4.0.16, for Win95/Win98 (i32)

C:\mysqldump --help | grep table
STDIN   6   Dumping definition and data mysql database or table
STDIN   7   Usage: mysqldump [OPTIONS] database [tables]
STDIN   22--add-drop-tableAdd a 'drop table' before each 
create.
STDIN   31In this case no tables are given. 
All name arguments are
STDIN   41-K, --disable-keys  '/*!4 ALTER TABLE tb_name 
DISABLE KEYS */; and
STDIN   42'/*!4 ALTER TABLE tb_name ENABLE 
KEYS */; will be put
STDIN   54-x, --first-slave   Locks all tables across all 
databases.
STDIN   61-l, --lock-tables   Lock all tables for read.
STDIN   65--no-autocommit Wrap tables with autocommit/commit 
statements.
STDIN   67Dump all tables in single 
transaction to get consistent
STDIN   68snapshot. Mutually exclusive with 
--lock-tables.
STDIN   74Don't write table creation info.
STDIN   80--opt   Same as --add-drop-table --add-locks 
--all --quick
STDIN   81--extended-insert --lock-tables 
--disable-keys
STDIN   88-Q, --quote-names   Quote table and column names with a 
`
STDIN   94-T, --tab=name  Creates tab separated textfile for 
each table to given
STDIN   98--tablesOverrides option --databases (-B).
STDIN   112 add-drop-tableFALSE
STDIN   132 lock-tables   FALSE


C:\mysqldump --help | grep ignore

nada.

Ummm. What version are you using, Martin?

David

[PHP-DB] MySQL 4.1 as Backend

2005-07-05 Thread dpgirago
Anyone using MySQL 4.1 as a backend to their PHP apps? I'm particularly 
interested in the cluster software that the docs say are part of 4.1. I 
have some apps that would benefit from a high uptime db backend but I'm a 
bit concerned about the 'not enterprise-ready' disclaimer on the mysql 
website for the 4.1 package.

David

Re: [PHP-DB] load data infile -- problem

2005-08-18 Thread dpgirago
You can definitely do a load file from within the mysql client, so I'd 
guess you can do it through mysql_query, too. I'm wondering about the 
semi-colon within the query. Maybe it needs to be escaped, too.

David

 I could be 100% wrong on this, but I do not think that a command line 
 statement can be executed through mysql_query() - try exec().
 If I remember correctly mysql load data infile ... is not executed from 
 within mysql, but at the command line.

 (Hint: look at the source for phpMyAdmin and copy how it is done.)

 Regards - Miles


At 08:30 AM 8/18/2005, select.now wrote:
Helo everyone !
I find this problem and I think I am close to the solution but ...

The question: I need to import a few thousand of record storee in a 
*.csv 
file on my local harddisk, with my php application, managing my mysql 
engine.

So, in command line, all works fine, all records are correctly imported.
 command line code -
 mysql load data infile 'c:\\datastream\\import\import
-into table iport
- fields terminated by ';'
- ignore 9 lines;
- /command line code 

But in my php app, because I am confuse a bit (use of ['], [] and the 
definition of variables in mysql_query), I don't make this import.

-- php code ---
$a = 'c:\\\datastream\\\import\\\import';
$extra_arg = 'fields terminated by \';\' ignore 9 lines;';
$query = 'load data infile \''.$a.'\' into table import '.$extra_arg.'';
$result = mysql_query ($query) or die_mysql (brExecutia comenzii 
i$query/i a esuat.br);
-- /php code --

I get this output-error:
===
  load data infile 'c:\\datastream\\import\\import' into table import 
 fields terminated by ';' ignore 9 lines;
===
and the import doesn't occured.


Where is located my mistake ?

Thanks in advance.

--
cu respect, [EMAIL PROTECTED]

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

RE: [PHP-DB] retrieve text from pdf

2005-09-07 Thread dpgirago
Hello Yui,

We use an executable called pdftotext.exe to extract text from pdf's.

You can find it here: - http://www.foolabs.com/xpdf/download.html

Although we use it from the command line, I'd guess that it can be used 
satisfactorily with exec() within a PHP script, also.

David






Bastien Koert [EMAIL PROTECTED]

09/07/2005 08:30 AM



 

To:
[EMAIL PROTECTED], php-db@lists.php.net
cc:





Subject:
RE: [PHP-DB] retrieve text from pdf



Are you looking for the text of the document or the data from forms 
embedded 
in the PDF?

For the latter you can use the FDFToolkit from adobe.

Bastien


From: Yui Hiroaki [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] retrieve text from pdf
Date: Wed, 07 Sep 2005 13:57:51 +0900

hi! Anyone know how to retrieve text from pdf?
If someone knows how, please teach me the code or site?

Regards,
yui

--
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] connection to mysql db

2005-10-11 Thread dpgirago

You need to use the username and password of the database, not the OS, to
connect to MySQL. You would also need to set up an account for the
username/host name of the remote computer within MySQL for this to work
successfully. If this is a new installation of MySQL, try leaving username
and password blank as I think there is a default account with open
credentials. In any event, have a look at the user table in the mysql
database for the accounts that have been already set up.

David



|-+--
| |  |
| |  |
| |blackwater dev|
| | [EMAIL PROTECTED]|
| |  |
| |  |
| |  |
| |   10/11/2005 08:51 AM|
| |  |
| |  |
| |  |
|-+--
  
-|
  | 
|
  | 
|
  | 
|
  |To:  
|
  |  php-db@lists.php.net   
|
  |cc:  
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  |Subject: 
|
  |  [PHP-DB] connection to mysql db
|
  | 
|
  
-|




I have mysql running on a linux box at my house.  I want to connect to
that box from another machine on my home network but get access
errors.  When connecting, I use the machines internal ip and the root
name and password of the linux box but I get access denied errors.
How can I connect?

Thanks!

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

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



Re: [PHP-DB] Google Style Search Results

2005-12-07 Thread dpgirago

It's possible that the keywords wouldn't be in the  first X numbers of
characters.




|-+--
| |  |
| |  |
| |   Joseph Crawford|
| |  [EMAIL PROTECTED]|
| |  |
| |  |
| |  |
| |   12/07/2005 02:11 PM|
| |  |
| |  |
| |  |
|-+--
  
-|
  | 
|
  | 
|
  | 
|
  |To:  
|
  |  [PHP-DB] Mailing List php-db@lists.php.net 
|
  |cc:  
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  |Subject: 
|
  |  Re: [PHP-DB] Google Style Search Results   
|
  | 
|
  
-|




why not use substr?
$preview = substr($string, 0, 50) .'...';

it will probably cut off in the middle of a word, but you can use strpos
and
check to see if the char is a space to get to the point you want.

--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]

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



Re: [PHP-DB] Re: SQL Insert INTO question

2005-12-08 Thread dpgirago

In full agreement here. I scratched my head this morning, then looked up
INSERT in the MySQL Docs for a sanity check. It must be an UPDATE
statement to work as indicated below.

David

 Sorry David Mitchell 

==

Is that a syntax supported by MySQL?  That is, an INSERT with WHERE clause?
I tried it against Oracle, and it doesn't work (can you imagine how
upsetting it would have been to have learned that, after having worked with
SQL for several years, one can do an update using an INSERT statement?).
I'm pretty sure it doesn't work against MS SQL Server, DB2, etc (not 100%
certain, but 99.9%).

On 12/8/05, El Bekko [EMAIL PROTECTED] wrote:

 geekgirl1 wrote:
  First time poster.
 
  This is the problem.  I want to add the value of $_POST[review] to the
  reviews table where the unique id from the reviews table equals the
  review id on my form.  The statement below does not work.  Should I
  use UPDATE instead?
 
  INSERT INTO reviews (review_txt)
VALUES
('$_POST[review]') WHERE review_id = $id;
 
  Marian

 INSERT INTO reviews (review_txt)
VALUES
('$_POST[\'review\']') WHERE review_id = '$id';

 There, now it should work :)

 --
 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] Minor Change

2005-12-12 Thread dpgirago

Ken:

Echo out the query. Check it. Run it from the MySQL client.

 What does the error message say? Does the table 109fh6 actually exist in
the database?

David

#  Ken responded:
#
# After adding echo mysql_error(); I get the same result.  I tried changing

# the query to include 109fh7 (a table which doesn't exist) and got the
same
# result as with 109fh6.  Changing to 109fh5 does pull up that table.  The

# line to which the error message refers is while ($row = mysql_fetch_assoc

# ($data_set))  That is what always come up when there is an error in the
# query.

**
On Mon, 12 Dec 2005 14:13:10 -0500, Micah Stevens
[EMAIL PROTECTED] wrote:


 You're getting an error, after the query, put:

 echo mysql_error();

 to find out what's happening.

 On Monday 12 December 2005 11:05 am, [EMAIL PROTECTED] wrote:
 I made tiny changes to my php file and sql table and the table won't
 come
 up.  I updated the table name (and php file name) from 109fh5 to 109fh6.
 In the table, I changed 6 cells, leaving a couple blank.  Then I changed
 only the digit 5 to make it a 6 (109fh6) in the following:

 $get_data_query = select rep, party, state, cd, minority, afr_am,
 asian,
 am_indian, hispanic, med_hsehold_income, poverty from 109fh6 order by
 $sort_field $sort_order;

 Now I get Warning: mysql_fetch_assoc(): supplied argument is not a
 valid
 MySQL result resource in etc.

 I've done this many times without a problem (this is the 6th time in
 this
 sequence).  What could be wrong after such a minor change?

 Ken


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



[PHP-DB] Dynamic Navigation Bar

2005-12-22 Thread dpgirago
Results from full-text searches on a documents database are returning
sometimes 300-400 hits, so I'm gonna need to implement a dynamic navigation
bar. Perhaps this a stupid question, but it seems from a brief googling
that navigation bars -  dynamic or not - operate by appending variables and
values to the URL within the A href=...link/, which are then grabbed
from the $_GET array.  Can someone shed some light on whether this the only
method used?

 And, yes, I know that there is a Pear package that does this, but I'm more
inclined to implement my own at present.

Thanks very much.

David

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



RE: [PHP-DB] Dynamic Navigation Bar

2005-12-22 Thread dpgirago


Thanks for the quick response, Bastien.
I was thinking that using hidden fields may be another way to go. But how
would I assign a value to a form variable via clicking on a link?

No, you could try keeping that data in sessions or in hidded form fields
in
the page...note that the latter requires that you do a page submit with
the
onclick of the link / button

Bastien


From: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Dynamic Navigation Bar
Date: Thu, 22 Dec 2005 09:27:33 -0600

Results from full-text searches on a documents database are returning
sometimes 300-400 hits, so I'm gonna need to implement a dynamic
navigation
bar. Perhaps this a stupid question, but it seems from a brief googling
that navigation bars -  dynamic or not - operate by appending variables
and
values to the URL within the A href=...link/, which are then
grabbed
from the $_GET array.  Can someone shed some light on whether this the
only
method used?

  And, yes, I know that there is a Pear package that does this, but I'm
more
inclined to implement my own at present.

Thanks very much.

David

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



Re: Fw: [PHP-DB] Dynamic Navigation Bar

2005-12-23 Thread dpgirago

Thanks for weighing in on the question, Julien. It's an intranet
application, and I have some influence with the users' browser settings, so
I used Javascript. I have to admit though that I was unaware you could pass
a function from an anchor href tag
(a href=javascipt:myFunction(paramenters,...);link/a, for those
similarly in the dark). Dynamically creating the links with their
associated offset for use with MySQL's limit syntax works very well. I'm
curious if anybody knows how long Javascript has supported this syntax? I
found example scripts using it beginning in chapter 15 of Danny Goodman's
JavaScript Bible (5th Edition) 2004, so I'm guessing it's part of the
Document Object Model specification, but I didn't explore it's origins.

Thanks Bastien and Julien.

David

 From: Julien Bonastre [EMAIL PROTECTED]
 To: Bastien Koert [EMAIL PROTECTED]
 Sent: Friday, December 23, 2005 11:01 PM
 Subject: Re: [PHP-DB] Dynamic Navigation Bar


I would suggest using the GET method..


 Unless you have some reason you don't want the data passed via GET..


 In which case I suggest just storing all that in a session..


 So for example, I wouldn't want to pass a big ugly html-encoded query
 string via the GET URI, as it would look awful

 Instead, set a session variable holding that query and any related
details
 you are also processing [ie user selected sorting of results
 [ascending/descending] etc, fields to sort by, whatever options you have]

 and just pass a 'pg' value via get

 such as ./search.php?pg=2

 or something..

 As as alternative to the javascript form POSTing method..


 Its up to you, I'm just providing an alternative to using Javascript
which
 as someone else outlined is CLIENT side, hence you are relying on correct

 operation by the browser for it to work..

 I don't like relying on the clients browser, I like relying on my code..



 Enjoy

 ---oOo--- Allowing users to execute CGI scripts in any directory should
 only be considered if: ... a.. You have no users, and nobody ever visits
 your server. ... Extracted Quote: Security Tips - Apache HTTP
 Server ---oOo--- --oOo---oOo-- Julien Bonastre
 [The_RadiX] The-Spectrum Network CEO ABN: 64 235 749 494
 [EMAIL PROTECTED]
 www.the-spectrum.org --oOo---oOo--
 - Original Message -
 From: Bastien Koert [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; php-db@lists.php.net
 Sent: Friday, December 23, 2005 1:39 AM
 Subject: RE: [PHP-DB] Dynamic Navigation Bar


 javascript

 Bastien


From: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: RE: [PHP-DB] Dynamic Navigation Bar
Date: Thu, 22 Dec 2005 09:38:01 -0600



Thanks for the quick response, Bastien.
I was thinking that using hidden fields may be another way to go. But
how
would I assign a value to a form variable via clicking on a link?

 No, you could try keeping that data in sessions or in hidded form
 fields
in
 the page...note that the latter requires that you do a page submit
with
the
 onclick of the link / button
 
 Bastien


 From: [EMAIL PROTECTED]
 To: php-db@lists.php.net
 Subject: [PHP-DB] Dynamic Navigation Bar
 Date: Thu, 22 Dec 2005 09:27:33 -0600
 
 Results from full-text searches on a documents database are returning
 sometimes 300-400 hits, so I'm gonna need to implement a dynamic
navigation
 bar. Perhaps this a stupid question, but it seems from a brief
 googling
 that navigation bars -  dynamic or not - operate by appending
 variables
and
 values to the URL within the A href=...link/, which are then
grabbed
 from the $_GET array.  Can someone shed some light on whether this
the
only
 method used?
 
   And, yes, I know that there is a Pear package that does this, but
  I'm
 more
 inclined to implement my own at present.
 
 Thanks very much.
 
 David

--
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] Page Caching after DB Query

2006-01-05 Thread dpgirago
How can I force the browser to re-display the last dynamically created page
when using the back button, for example, rather than re-issuing the query.
Are there any complications because we are using the https protocol on
Apache?

David

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



Re: [PHP-DB] Page Caching after DB Query

2006-01-05 Thread dpgirago

/* for the archives */

Ah, it's in the manual, isn't it?

I was calling session_start() on the page, so the session.cache_limiter
value of 'nocache' in php.ini was overriding all attempts to cache the
page.
Calling session_cache_limiter('private') before session_start() did the
trick.

David

 How can I force the browser to re-display the last dynamically created
page
 when using the back button, for example, rather than re-issuing the
query.
 Are there any complications because we are using the https protocol on
 Apache?

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



[PHP-DB] No posts in 36 hours??

2006-01-11 Thread dpgirago
List Active?

David

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



Re: [PHP-DB] Mirroring two DB

2006-02-28 Thread dpgirago

 I want to know how to mirror one MySQL database installed in two
 different servers so they can be synchronized.

Any idea?

Search the MySQL docs/manual for master and/or slave.  There are good
examples for setting up replication from many different web sites as well.

David

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



Re: [PHP-DB] Problem with a login page.

2006-03-06 Thread dpgirago

snip...

// check passwords match

$_POST['password'] = stripslashes($_POST['password']);
$info['password'] = stripslashes($info['password']);
$_POST['password'] = $_POST['password'];

if ($_POST['password'] != $info['password']) {
die('Incorrect password, please try again.');
}
snip...

Alex,

Sticking for the moment with the error message you get, I can't see
anyplace where an array named $info with a key of password is declared
or assigned this value. Are you sure that this variable exists?

David

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



Re: [PHP-DB] MySQL - Unable to run service

2006-03-15 Thread dpgirago

 I have been using MySQL for quite some time and am now running Server
4.1. I
 have been developing custom web-based software for a customer and
recently
 moved their server to a different machine. I have everything running
 smoothly EXCEPT for mySQL. Any time I try to start the service I get an
 error:

 Error 1067: Unable to start service on Local Computer.

 Anyone have an idea about that? That user logged in is the comp
 administrator.

Is this on Windows?

Did the service install OK?

Is this the message you get when you try net start mysql?

David

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



Re: [PHP-DB] Quiet lately....

2006-04-04 Thread dpgirago

 ^bump^


 its too quiet in here!


 Has something exciting happened in the U.S. of A. ??



A certain Texas politician under indictment for felony charges announced he
is going to resign in June, but surely this is off-topic.

 [hehehehehehehe]

David

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



Re: [PHP-DB] short text strings with apostrophes and forms

2006-04-20 Thread dpgirago

 I have an application which calls up some data from a MySQL table and
 puts it into a web form for users to modify.

 One of the cells holds a text string which is put into a text input
 field. However, if that text string includes an apostrophe, all text
 after the apostrophe disappears.

 For example, if the test string from a database cell reads...

 Fix the managers' cars by Tuesday

 and that is saved in the variable $some_text, which is called up in a
 form...

 input type='text' name='some_variable' value='$some_text'

 The text field on the web page will only contain...

 Fix the managers

 How can I get the text field to show the entire string?

 Many thanks,

 Jeffrey


htmlentities($some_text, ENT_QUOTES) is more robust than htmlspecialchars
();

David

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



Re: [PHP-DB] Single quotes in INSERT statements?

2006-04-25 Thread dpgirago

Skip Evens wrote:
 Hello all,

 I'm brand spanking new to the list and have a
 quick question.

 I was under the impression that addslashes() would
 handle single quote marks in INSERT statements,
 but when I execute the following:

 $sql=UPDATE images SET orderno=$orderno,
 url='.addslashes($url).',
 banner=$banner,caption='.addslashes($caption).'
 WHERE imageID=$imageID;

 ...and $caption contains something like:

 Don't look

 ...the data is chopped off at the single quote mark.

 How, if not addslashes(), does one handle this?

Skip,

If you're using MySQl, try mysql_escape_string(), or
mysql_real_escape_string.
If using some other RDBMS, look for similar functions in their respective
manual(s).

You might also investigate the setting of the magic_quotes directive in
php.ini, or use
get_magic_quotes_gpc to return this value programmatically.

Hope this helps.

David

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



Re: [PHP-DB] Single quotes in INSERT statements?

2006-04-26 Thread dpgirago

 Skip Evans wrote:

Hello all,

I'm brand spanking new to the list and have a
quick question.

I was under the impression that addslashes() would
handle single quote marks in INSERT statements,
but when I execute the following:

$sql=UPDATE images SET orderno=$orderno,
url='.addslashes($url).',
banner=$banner,caption='.addslashes($caption).'
WHERE imageID=$imageID;

...and $caption contains something like:

Don't look

...the data is chopped off at the single quote mark.

How, if not addslashes(), does one handle this?

 No, neither mysql_escape_string or
 mysql_real_escape_string worked.

 Yes, I am using MySQL, should have said that, sorry.

 But anyway, even with both of these functions, the
 data in the string containing the single quote as
 in Don't Look is still being truncated at the
 single quote mark.

 Any other suggestions would be greatly appreciated.

 Skip

For the archives:

Subject of this thread is misleading since the problem was not one of an
INSERT failing but of HTML not displaying properly because of quotes or
other special characters in the text in the database. Just goes to show
that the best way to get the right answer is to analyze the problem
accurately and ask the right question.

David

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



  1   2   >