Re: [PHP-DB] addslashes()

2002-02-07 Thread Paul DuBois

At 16:54 -0600 2/7/02, Todd Williamsen wrote:
Ok..

i tried it out... and it almost works like I want it... weird though

1. when I put in pfont color=bluethis is BLUE/p/font

it prints it in like a bright green.  but if i use the RGB # then its fine.
weird

2.  if there is an apostrophe in the notes, then it will add slashes it to
that as well

so if I type blah blah blah I am going over to my friend's website later on
and here is the address...

a href=http://friends.comFriends/a

it will look like

friend\\\'s

Friends(link)

addslashes() is for escaping values that you're going to insert into a
database.

If you're generating HTML, use htmlspecialchars() instead.

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




Re: [PHP-DB] MySQL connect

2002-02-04 Thread Paul Burney

on 2/4/02 12:54 PM, J Leonard at [EMAIL PROTECTED] appended the following
bits to my mbox:

 mysql_connect($db[host],$db[user],$db[password],$db[database]) or

The above function call only has three parameters.   The database isn't
specified in the connect call but selected later. Try:

mysql_connect($db[host],$db[user],$db[password]);
mysql_select_db($db[database])

Paul

?php
while ($self != asleep) {
$sheep_count++;
}
?



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




Re: [PHP-DB] Re: LEFT JOIN in UPDATE

2002-02-03 Thread Paul Burney

on 2/3/02 3:36 PM, Lutz Brückner at [EMAIL PROTECTED] appended the following
bits to my mbox:

 Question is how to properly form a LEFT JOIN using
 UPDATE... I tried:
 
 UPDATE product_price LEFT JOIN temp
 SET product_price.product_price_vdate = 1 (del flag)
 ON product_price.product_id = temp.product_id
 WHERE temp.product_id IS NOT NULL

 I just read http://www.mysql.com/doc/U/P/UPDATE.html once more,
 but can not find anything about mysql supporting JOIN in UPDATE
 statements.

I believe Lutz is right.  You are using PHP, right?  Any MySQL?

Some RDBMS systems provide ways of linking database table records to each
other via foreign keys and others allow you to create triggers that are
performed by the database server when certain actions happen.

MySQL does not.  They believe the application programmer should take care of
those application pieces.

So, if you're using MySQL, do the select statement first with the join, then
loop through the results and perform the update.

Paul

?php
while ($self != asleep) {
$sheep_count++;
}
?



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




[PHP-DB] parse error

2002-02-02 Thread M . E . Paul

I'm working through the New Riders MySQL book and I get the following error
when running a php script, can someone help? Thanks, Matt - 

Parse error: parse error in c:\program files\apache
group\apache\htdocs\genesis\dump_info.php on line 25


Here's lines 25 - 

printf (TD%s/TD\n, htmlspecialchars ($row[$i]));

Here's the full code if that helps - 

?php
# dump_names.php - dump Genesis info

include (genesis.inc);

$title = Genesis info list;
html_begin ($title, $title);

genesis_connect ()
or die (Cannot connect to server);

# issue query
$query = SELECT collector_material, name, description, coating, size FROM
mp ORDER BY name;
$result = mysql_query ($query)
or die (Cannot execute query);

print (TABLE\n);
# read results of query, then clean up
while ($row = mysql_fetch_row ($result))
{
print (TR\n);
for ($i = 0; $i  mysql_num_fields ($result); $i++)
{
# escape any special characters and print
printf (TD%s/TD\n, htmlspecialchars ($row[$i]));
}
print (/TR\n);
}
mysql_free_result ($result);
print (/TABLE\n);

html_end ();

?

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




Re: [PHP-DB] request and response objects?

2002-01-30 Thread Paul DuBois

At 12:30 -0600 1/30/02, Matthew Crouch wrote:
basically a yes or no question my brother wants me to ask:
Does PHP support these objects? If not, Can they be faked?

What, like in Java servlets/JSP pages?

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




[PHP-DB] mySQL 4.0.2-alpha

2002-01-28 Thread Paul Stevens

Hi guys,

I'm running mySQL 3.23.43 at the mo' with PHP-GTK 0.5.0. Long and the short
of the matter is, anyone running mySQL 4.0.2-alpha in anywhere near a
production 
environment yet, and if so, how is it? My server is a Win2K Server SP2
box...so how steady are those windows binaries??? :-)

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




Re: [PHP-DB] UPDATE query to add to a field

2002-01-28 Thread Paul DuBois

At 9:06 -0800 1/28/02, Adv. Systems Design wrote:
hello all:

I need to be able to update a field in MySQL, the catch is that I 
have to add on to text that is already there and I have to be able 
to do it within MySQL (phpMyAdmin). My first idea was to do:

SET prod_desc = prod_desc + more info to tack on to end

but this is a mathematical function which returns 0!

Use CONCAT().

Any ideas?

Thanks


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




[PHP-DB] Re: [PHP] PHP and MYSQL Security`

2002-01-27 Thread Paul DuBois

At 16:59 -0800 1/27/02, Fred wrote:
If this file has a .php extension remote users will not have access to the
variables because the file is parsed by php and they never see the actual
file contents when requesting the document via the web.  If you are
concerned with users on localhost having access to the file, simply give it
the correct permissions so that no one else has read access.

No so easy.  The server itself must have read access.  If other users on
the local host can install scripts that the server executes, any of those
scripts can read the text of your scripts.

What then? You're hosed.


If you are concerned about web users having access, if, for example, the php
parser crashed and apache tried to pass the file through without parsing,
you can put the default server, user and pass variables in the php.ini file
which is not in the document root for apache.  Of course, this only works if
all of your scripts use the same server, user and password.

Fred

Duky Yuen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  How can I secure my username and password? In 1 of my files, it contains
  the following:

  $conn = mysql_connect( 12.34.56.78, username, password);
  mysql_select_db(database,$conn);

  What should I do, so people can't get this information?

  Duky




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


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




Re: [PHP-DB] Sum Columns

2002-01-25 Thread Paul DuBois

At 23:19 -0600 1/25/02, [EMAIL PROTECTED] wrote:
Hello,

I've been experimenting with adding decimal columns. From the mysql docs I
got this SELECT sum(value) FROM pets;

So I did this  $result = mysql_query(SELECT sum(value) FROM pets,$db);
 $myrow = mysql_fetch_array($result);
 print $myrow[value];
I also tried $myrow[sum].

You're selecting a column named sum(value) not value or sum.
$myrow[0] should give you the value you're looking for.  Or modify your
query to add a column alias, and use the alias name:

$result = mysql_query(SELECT sum(value) AS the_sum FROM pets,$db);
 $myrow = mysql_fetch_array($result);
 print $myrow[the_sum];



How can I get the sum displayed?

Thanks in advance,
Mike


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


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




Re: [PHP-DB] distinct - how to do

2002-01-19 Thread Paul DuBois

At 2:28 +1300 1/20/02, Barry Rumsey wrote:
I have the following query:
$query = SELECT  * FROM xp_topics, xp_stories WHERE 
xp_topics.topicid = xp_stories.topicid AND 
xp_topics.artistname='Faith Hill' ORDER BY topictext DESC LIMIT 
0,20;
It returns the lot but a lot of doubles.
  I want to put a DISTINCT call the query, but if I put it after the 
select ( select distinct * from...) it returns nothing. How do 
you do a DISTINCT?

That's how you do it (add DISTINCT after the SELECT keyword).
You must be doing something else wrong.

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




Re: [PHP-DB] Storing Credit Card info

2002-01-17 Thread Paul G

Hi olinux,

If I understand what you are saying...I would use mcrypt and encrypt the
stored info, keeping the KEY and IV in a separate location for when you need
it. Chances that anybody will break the triple des encryption without the
KEY and IV are slim to none. That way, you don't have to freak out about
moving the information around, that is, until it has been decrypted.

In order to convert the KEY and IV into a normal string, you need to use
some base64 conversion function, I don't remember where I got that or if it
was built into PHP when I did it, but I was able to get it to work pretty
quickly. PHPs hooks into the mcrypt libraries are the best. So easy to
use(and high quality) compared to anything else I've seen.

Hope that helps,

-Paul

- Original Message -
From: olinux [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 17, 2002 1:22 PM
Subject: [PHP-DB] Storing Credit Card info


 I have a client that would like to store credit card
 information online. I have worked with shopping cart
 type systems in the past, but never stored CC info.

 What is the best way to do this? I was thinking that I
 can write and read using include() to a directory that
 is not available to the web. Then just display these
 on SSL so that the client can retrieve the numbers.
 Any ideas?

 Thanks much,
 olinux

 __
 Do You Yahoo!?
 Send FREE video emails in Yahoo! Mail!
 http://promo.yahoo.com/videomail/

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



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




Re: [PHP-DB] Storing Credit Card info - Encryption Functions

2002-01-17 Thread Paul G

Hi olinux,

This is what I ended up doing. This will work if you have a PHP that was
compiled with mcrypt as it is, just pass the info to your encrypt and
decrypt functions. The key I used is 123 but you can use something
different. The Initialization Vector is hard coded, but there is a function
that will generate a new one for you. Look at the mcrypt_encrypt and
mcrypt_decrypt functions at php.net for details. I lifted the hex2bin() from
the user comments If I remember correctly.

Have Fun...

-Paul


/
function encrypt($plainText)
{
 return(bin2hex(mcrypt_encrypt (MCRYPT_RIJNDAEL_256, 123, $plainText,
MCRYPT_MODE_ECB,
hex2bin(f6d53befbaac65a609e24d4b3a573ec56618b185280b615b6cde67793c7e4091))
));
}

/
function decrypt($cipherText)
{
 return(mcrypt_decrypt (MCRYPT_RIJNDAEL_256, 123, hex2bin($cipherText),
MCRYPT_MODE_ECB,
hex2bin(f6d53befbaac65a609e24d4b3a573ec56618b185280b615b6cde67793c7e4091))
);
}

/
function hex2bin($data) {
 $len = strlen($data);
 for($i=0;$i$len;$i+=2) {
 $newdata .= pack(C,hexdec(substr($data,$i,2)));
 }
 return $newdata;
}

/

- Original Message -
From: olinux [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 17, 2002 1:22 PM
Subject: [PHP-DB] Storing Credit Card info


 I have a client that would like to store credit card
 information online. I have worked with shopping cart
 type systems in the past, but never stored CC info.

 What is the best way to do this? I was thinking that I
 can write and read using include() to a directory that
 is not available to the web. Then just display these
 on SSL so that the client can retrieve the numbers.
 Any ideas?

 Thanks much,
 olinux

 __
 Do You Yahoo!?
 Send FREE video emails in Yahoo! Mail!
 http://promo.yahoo.com/videomail/

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



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




Re: [PHP-DB] mail() on Mac OS X

2002-01-15 Thread Paul Burney

on 1/15/02 7:38 AM, Adam Royle at [EMAIL PROTECTED] appended the
following bits to my mbox:

 I have been trying for months now (on and off) to get mail() working in
 OS X. I

 - I am using PHP v4.0.6 on Mac OS X 10.1 (pre-compiled with cool options
 from entropy.ch)

 - I installed Communigate Pro (a mail server -- and this works when I
 use it in Mail.app)

1) This post should've gone to PHP-General since it isn't related to
databases.

 SMTP = ifunk.dyndns.org
 sendmail_from = [EMAIL PROTECTED]

2) These values are only valid for Windows php installs, not for Unix (i.e.,
Mac OS X.

 - I don't want to use sendmail, I want to use the mail server I have
 already installed.

FWIW, OS X comes with sendmail installed, you just need to enable it in the
/etc/hostconfig file.

Perhaps Communigate Pro has a sendmail type wrapper that you can point the
php sendmail value to.  I've heard that qmail has such a script.  Check with
CG Pro support for more info.

Another option would be to use Manuel Lemos' excellent SMTP class for
sending you email directly through an smtp server.

http://phpclasses.upperdesign.com/

Of course, then you wouldn't actually be using the mail() function.

HTH.

Paul

?php
while ($self != asleep) {
$sheep_count++;
}
?



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




Re: [PHP-DB] mysql_insert_id?

2002-01-15 Thread Paul Burney

on 1/15/02 4:08 PM, Wee Chua at [EMAIL PROTECTED] appended the
following bits to my mbox:

 Is it possible that I would get the wrong ID (Not the ID I just inserted in
 Auto_Increment field) by using mysql_insert_id function if someone is also
 inserting record at the same time? How does mysql_insert_id work accurately?

1) Please don't cross post to two lists.

2) No.  MySQL uses separate threads for each connection.  They don't
interact with one another.  Check the mysql docs for more info.

Paul

Paul

?php
while ($self != asleep) {
$sheep_count++;
}
?



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




[PHP-DB] FreeBSD 4.2 and ODBC

2002-01-15 Thread Paul G

Hi All,

I'm just new to this list and I'm hoping somebody might have information leading to a 
PHP that can access an MS Excel Spreadsheet. FreeBSD 4.2, PHP 3.0.18 (for gif GD), 
Apache1.3.12.

I have had no luck getting any of the ODBC functions to work with this OS 
(odbc_connect, php compiled with and without --with-iodbc switch results in Fatal 
error: Call to unsupported or undefined function odbc_connect() ). I also had no luck 
compiling iODBC, which resulted in syntax errors and ultimately stoppage.

Wondering if anybody has a gem out there. |:) Ever pull something like this off? Got 
any ideas?

Thanks Alot!

-Paul



Re: [PHP-DB] FreeBSD 4.2 and ODBC

2002-01-15 Thread Paul G

Thanks Andrew,

I will attempt this in the morning. Is it okay with you if I email you on
the iODBC stuff? PHP was compiled like so:

Configure command: ./configure '--with-apxs=/usr/local/apache/1.3/bin/apxs'
'--with-config-file-path=/usr/local/lib' '--with-system-regex'
'--enable-track-vars' '--enable-trans-sid' '--enable-versioning'
'--with-ttf' '--with-ftp' '--with-gd=/usr/local' '--enable-memory-limit'
'--enable-fast-install' 'with-iodbc=/usr/local/src/odbcsdk'
php3.ini file path is set to: /usr/local/lib

(iODBC resulted in syntax errors last time I tried. I am new to this I
should emphasize!) Also, any ODBC driver you would recommend?

-Paul

- Original Message -
From: Andrew Hill [EMAIL PROTECTED]
To: Paul G [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, January 15, 2002 2:37 PM
Subject: RE: [PHP-DB] FreeBSD 4.2 and ODBC


 Paul,

 You can simply download the binary at www.iodbc.org and
 configure --with-iodbc as per the HOWTO.
 If you tried this and then got undefined function then this means you
 didn't use the correct php binary or somesuch.
 Ensure that ODBC support is compiled in by examining the output of a
 phpinfo();

 You will still need an ODBC driver, as iODBC is simple the Driver Manager
 (enabling use of a driver).
 To enable BSD to access an Excel spreadsheet will require the following
 configuration.

 BSD Client
 
 PHP --with-iodbc (using iODBC SDK, use non-threaded option if you get
 pthread errors)
 Client-side ODBC - OpenLink MT Client
 DSN (in odbc.ini) configured with:
 Host = windows box below
 ServerType = odbc
 Database = server-side DSN below (foo)
 Environment variables in your PHP script:
 putenv(ODBCINI=path/to/odbc.ini);
 putenv(LD_LIBRARY_PATH=path/to/odbcsdk/lib);
 (ODBCINSTINI is optional)


 Windows Server
 --
--
 ---
 Server-side ODBC: OpenLink MT ODBC Agent (choose Access in the selection
 dropdowns)
 foo - DSN configured with the Microsoft driver for Excel that can open
the
 spreadsheet

 All components are available as free downloads from OpenLink's website.
 Free support is available at
http://www.openlinksw.com/support/suppindx.htm

 Hope this helps!

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



  -Original Message-
  From: Paul G [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 15, 2002 5:29 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] FreeBSD 4.2 and ODBC
 
 
  Hi All,
 
  I'm just new to this list and I'm hoping somebody might have
  information leading to a PHP that can access an MS Excel
  Spreadsheet. FreeBSD 4.2, PHP 3.0.18 (for gif GD), Apache1.3.12.
 
  I have had no luck getting any of the ODBC functions to work with
  this OS (odbc_connect, php compiled with and without --with-iodbc
  switch results in Fatal error: Call to unsupported or undefined
  function odbc_connect() ). I also had no luck compiling iODBC,
  which resulted in syntax errors and ultimately stoppage.
 
  Wondering if anybody has a gem out there. |:) Ever pull something
  like this off? Got any ideas?
 
  Thanks Alot!
 
  -Paul
 



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



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




Re: [PHP-DB] The New Guy

2002-01-14 Thread Paul Burney

on 1/14/02 2:12 PM, Daniel Barton at [EMAIL PROTECTED] appended the following
bits to my mbox:

 Well maybe I should just go out and join that perl list.

I was going to respond to you but I didn't have a good answer.  :)

I don't know of any built in PHP functions that do what you are looking to
do.  There are some special fgets-type functions for use with CSV, but
nothing that treats it as SQL.

You might want to try the PEAR repository to see if they have anything, but
I'm not hopeful.

For those of you who aren't familiar with it, the Perl DBI::CSV module
allows you to use a CSV file as a simple SQL database.  Very nice if you
don't have a real database to work with (which in this case, Mr. Barton
doesn't).

I was at a workshop by Randal Schwartz where he showed a bit of how to use
it.  Very cool...

If you can't get the clients to go for the extra cost, I'd recommend going
with Perl.  Choose the best tool for the job at hand, TMTOWTDI.

Paul

?php
while ($self != asleep) {
$sheep_count++;
}
?



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




Re: [PHP-DB] mail() - Return-Path

2002-01-12 Thread Paul Burney

on 1/12/02 7:36 AM, Malcolm White at [EMAIL PROTECTED] appended the
following bits to my mbox:

 4. No error messages. An email constructed as above sends perfectly - but
 the return path defaults to the apache user (in my case www) not the
 supplied return path. I tested the header construction by changing
 Return-Path: to X-Path: and the X-Path: header appears correctly. I am not
 sure but it seams that the real Return-Path is not overidable.

It's a sendmail config thing.  Do you have access to the server? Or is at a
web host?  

If you can get access to your php.ini file and restart apache, you can
change the sendmail path to:

sendmail -t -i -f [EMAIL PROTECTED]

That bounces all mail to that address.  I believe that in PHP 4.0.6 they
added another parameter of the mail function that lets you add options to
sendmail from each script, but check the docs.

HTH.

Paul

BTW, since your original message wasn't about databases and PHP, it
should've gone to PHP-General.


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




Re: [PHP-DB] Checkboxes, PHP, and MySQL

2001-12-20 Thread Paul DuBois

On Thu, Dec 20, 2001 at 11:40:14AM -0500, SpyProductions Support Team wrote:
 I've looked around in a few of the PHP lists for an answer to this, but
 can't come up with one.

On this question, you'd be better off just reading an HTML reference.
It doesn't matter what the value of a checkbox is.  If you want it
to appear checked when the browser displays it, you should supply a
checked attribute:

input type=checkbox name=firstvalue value=$result[32] checked

 
 Here's what I am doing:
 
 I have a form with a few checkboxes.
 
 When the information as to whether the checkboxes are checked or not is
 'saved' into the MySQL table, they are represented by a value of '1' - fine.
 
 When I want to edit this information, in the form of a similar form with
 checkboxes, the boxes are not checked off if they were before.
 
 What I am stuck on is how a checkbox can get checked off when pulling
 information from the MySQL as an array.
 
 Here's a line of code showing my array coming out.
 
 input type=checkbox name=firstvalue value='$result[32]'
 
 $result is the array.
 
 I guess what I am asking is that if a checkbox is assigned a value of one,
 why doesn't it appear as already checked off?
 
 Thanks,
 
 -Mike

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




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

2001-12-14 Thread Paul DuBois

At 10:46 -0800 12/14/01, Richard S. Crawford wrote:
At the risk of sounding like a browser-snob...

The quotes probably don't matter in IE, but that's primarily IE 
allows (and, in my opinion, encourages) bad coding practices.

Your echo command really ought to look like this:

echo option value=\ . $row[ID] . \ $selected . $row[name] .
/option\n;

Many coders even forget to put in the closing tag: /option.  That 
would work in IE, and probably even in Netscape, but it's bad coding 
practice.

And the ID and name values should be encoded with htmlspecialchars()
in case they contain double quotes or something else special...


Strive to keep your code as compliant with XHTML1.1 standards as 
possible.  When you make the switch to XML, you will find your task 
much easier.

Weird-ass browsers indeed.  Hmph.



At 10:41 AM 12/14/2001, you wrote:
the value can be in single quotes also, altho i dont think quotes matter
unless you use opera or some other wierdass browser (you can also put
doubles using \)


Sliante,
Richard S. Crawford

http://www.mossroot.com
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
MSN: [EMAIL PROTECTED]

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




Re: [PHP-DB] Re: PostgreSQL versus MySQL

2001-11-23 Thread Paul DuBois

Has this thread got anything at all to do with PHP?

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




Re: [PHP-DB] PHP MySql

2001-11-23 Thread Paul DuBois

At 4:16 PM -0700 4/8/01, Jonathan Underfoot wrote:
I'm getting an Invalid Query error after inputting the following

connect to Server
select DB

$sql_query = UPDATE commentary SET com_num=$com_num, com_by=$com_by,
com_band=$com_band, com_title=$com_title, com_release=$com_release,
com_rating=$com_rating, com_body=$com_body, com_type=$com_type, WHERE
com_num=$com_num;
$result = mysql_query ($sql_query)
or die (Invalid query / error);

This is all directly from a form. The variables are all valid.  I've tried
making the query something like
UPDATE commentary SET com_release=test WHERE com_num=8 and even that
dosen't work.

test is a string and requires quotes around it.  Your query is indeed
invalid.


Ideas?

Thanx,

-Jonathan Underfoot


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




Re: [PHP-DB] Combination of SQL statements invalid in MySQL?

2001-11-22 Thread Paul DuBois

At 4:08 PM +0100 11/22/01, Andy wrote:
Hi there,

I am trying to do a combination of SQL statements like described in a SQL
bÛok. Is it possible, that mysql does not allow this syntax?

According to the MySQL Reference Manual, subselects are not supported.


Thanx Andy

Error:

Occured during executing DELETE FROM test_user_interests WHERE user_id =
(SELECT user_id FROM test_user WHERE user_name = 'herbert01') statement

Error: 1064 You have an error in your SQL syntax near 'SELECT user_id FROM
test_user WHERE user_name = 'herbert01') ' at line 3

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




Re: [PHP-DB] Result is not empty

2001-11-22 Thread Paul DuBois

Take out the while statement--
i.e. simply use:

$row = mysql_fetch_array($result);

the way you have things constructed now, the while statement 
evaluates true on the first iteration and $row equals the result row 
from the query. Because the while returned true, it is evaluated a 
second time, returns false, and $row = NULL.

-ib

Why would that matter?  He still sets the column variables on the first
iteration?  Yes, he needs no while loop, but the variables that are
set inside the loop should remain set after the loop terminates.



Kevin Schaaps wrote:

Greetings once again,

Today I hope to have a challenge for you. :)

I've created a query which returns 1 record. This is confirmed when testing
it in MySQL itself.
Now PHP sees that there is 1 record in the result, but is completely
unwilling to show the information.
The css responsible for that page does not change the color of the text so
it should (like all the rest of the page is) be visible.

Please help :)

Yours,

Kevin


$query = SELECT concat(rank_tbl.abbreviation, ' ', character_tbl.name, ' ',
character_tbl.surname) as CO,
   character_tbl.ircnick, character_tbl.email  FROM
character_tbl, rank_tbl, sim_tbl WHERE sim_tbl.co = character_tbl.id
   AND character_tbl.rank = rank_tbl.id AND sim_tbl.co =
character_tbl.id AND  character_tbl.rank  = rank_tbl.id
   AND sim_tbl.id = $sim_id;

 $result =   mysql_query($query);
 $num_rows   =   mysql_num_rows($result);

 if ($num_rows == 1)
 {
 while ($row = mysql_fetch_array($result));
 {
 $co =   $row[CO];
 $nick   =   $row[ircnick];
 $email  =   $row[email];
 };
 echo 
 table
 tr
 td width=\50\/td
 td width=\125\CO:td
 tda href=\$email\$co/a/td
 /tr
 tr
 td width=\50\/td
 td width=\125\IRC NICKtd
 td$nick/td
 /tr
 tr
 td width=\50\/td
 td width=\125\td
 td/td
 /tr
 /table;
 }
 else
 {
 echo br p class=\medium\No Commanding Officer assigned to
$name/p;
 };


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




[PHP-DB] Intro to PEAR:DB

2001-11-21 Thread Paul Meagher

 Now for the $15,000 question: does anyone else agree with this ? If
 PEAR::DB is not abstracting the database what is the purpose of such a
 library ?

I would suggest that Alexander's list of reasons for using PEAR:DB should
be written up in some introductory section to the manual for PEAR DB along
with some comment about the difference between a Unified DB and a Database
Abstraction Layer (based on some of Manual's remarks on the difference and
pointing to Metabase as an alternative for the latter).

 a) unifed API
 You havn't to think about the name of the command to send a query,
 connecting...

I agree.

I think it is a Unified API where a Unified API is defined as a common
interface to connect to a db, execute queries, fetch the result and report
errors.

 b) it offers helpful functionality

 I.e. don't care about quoting and escaping in SQL-Statments, the query
command
 does it for you. PEAR:DB contains different possibilties to access the
result
 set... (Yes you can write such functions too, but why recreate the
wheel?)

I agree.

Where helpful functionality is defined as:

1.  Deals with quoting and escaping of SQL-Statements
2.  Provides different access methods for result sets
3.  Provides an array of error trapping and error reporting features for
debugging
4.  Provides higher level constructs for connecting to a db, issuing
queries, and accessing result sets
5.  Provides a studly caps API for connecting to a db, issuing queries, and
accessing result sets
6.  Add your own to this list

  c) _helps_ to keep portability
 You have 'only' to change the SQL-statments, not the functions.

I agree again.  IMO, comments like these would be helpful in the intro to
PEAR: DB.

T Cox raises the point that we might be defining PEAR:DB into a corner
where all it really consists of are features that are useful to developers.
While I agree with that sentiment I also think it would be helpful if the
there were some explicit remarks about what PEAR:DB currently offers to the
web developer community.  Saying that it consists of features that are
useful to developers doesn't convey much to someone who is wondering
whether to use it or not - it is not an actionable comment.

At some point a long detailed article also needs to be written about what
portable database programming really consists off.  It would also be good
to have a FAQ that deals with some of the work arounds that you need to use
to deal with portability issues.  For example, what if you rely on the
autoincrementing feature in MySQL but Postgresql doesn't support it?  What
work around causes the least amount of reprogramming of db code when you
switch from using MySQL to PostgreSQL for example.

Regards,
Paul Meagher

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




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




[PHP-DB] MS Access Error

2001-11-13 Thread Paul Lalli

Hello,
I'm just beginning experimenting with MS Access and PHP. I found all the
tutorials online that explain how to create a DSN for my existing Access
database, and went through the procedure fine. The DSN I chose is
prototype and the database does not have a username or password. I then
created a very simple script:

HTML
HEAD
TITLEAccess connection/TITLE
BODY
?php
#Open a connection to an access database
$connection = odbc_connect(prototype,,);
if ($connection){
echo Connection establishedbr\n;
} else {
echo Connection NOT establishedbr\n;
}
?

When running this file, I get the following output:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft
Jet database engine cannot open the file '(unknown)'. It is already opened
exclusively by another user, or you need permission to view its data., SQL
state S1000 in SQLConnect in D:\www\Lalli\php\access.php on line 7
Connection NOT established

The server is running MS WinNT 4.0 SP6, with PHP 4.0. Can anyone help me
out?

Thank you,
Paul Lalli



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




Re: [PHP-DB] Session Broken

2001-11-08 Thread Paul DuBois

At 9:25 AM + 11/8/01, Russ Michell wrote:
1: Rid any whitespace between '?php' and 'session_start()'
2: You need to populate the variable you wish to use as a session 
variable before registering it

Is 2 actually true?  The sessions chapter in the PHP manual doesn't seem
to specify any order for using and registering, and in fact gives examples
to the contrary (see examples 2 and 3 in the chapter).


?php
session_start();
if(!isset($UserName)){
$UserName = guest;
session_register('UserName');
}

//rest of script goes here
?

HTH
Russ

On Wed, 7 Nov 2001 20:02:03 -0500 Matthew Tedder [EMAIL PROTECTED] wrote:


  Can anyone tell me why my session isn't working?  I have attached 
the problem
  script.  Without even going to another page, the $PHPSESSID and $UserName
  variables are both empty.  They are also empty on subsequent pages. 

  It starts with:
  =
  ?php

  session_start();
  session_register(UserName);

  /*= Check for New User Session =*/
  if(!isset($UserName))
  {
$UserName = guest;
  };
  ==

  And toward the end, it has the following:
  ==
  function ShowMessage($message)
  {
print br\n;
print table border=2 align=center\n;
print trtd align=centerfont color=yellow$UserName ($PHPSESSID):
  $message/font/td/tr\n;
print /table\n;
  }

  ?
  ==

  In this function, the variables are flat empty.
  
   --Matthew


#---#

   Believe nothing - consider everything

   Russ Michell
   Anglia Polytechnic University Webteam
   Room 1C 'The Eastings' East Road, Cambridge

   e: [EMAIL PROTECTED]
   w: www.apu.ac.uk/webteam

   www.theruss.com



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




Re: [PHP-DB] Not a valid MySQL result resource

2001-11-08 Thread Paul DuBois

At 2:04 AM +0100 11/9/01, MPropre wrote:
?php
//.../... first part of the code is to connect to the right DB on a MySQL
server. It works fine


//This code to show the query. It runs well under MySQL and gives 1 result :
  $query=SELECT Login, Password FROM `user` WHERE user.login=''$login'' and
user.password=''$password'';

//This var should contain a query result ressource:
  $result_query=mysql_query($query);

//Here's my error message after executing:

Not so fast.  Where's your error checking to verify that the
query actually succeeded?

if (!$result_query)
{
 die (Gee, I guess error checking is a good thing after all!
  . mysql_error ());
}

// Supplied argument is not a valid MySQL result resource in this line:
  $result_table=mysql_fetch_array($result_query);

// I thought that this var ($result_table) should contain the row of 2 cells
//And I expected to read $result_table['login'] or $result_table[0] as the
first cell of the row...
// I any of you can help me, poor php newby... :o) Great thanks !!

?



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


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




[PHP-DB] PHP4 Compile using Informix Client SDK

2001-10-03 Thread Paul Daly

Hi,

I have SuSe Linux v7.2 with working versions of Apache and MySQL.

The problem now is that I need to access an Informix Online v7.3 database
running on a separate AIX server.  This server has I-Net serving ODBC calls
from Windows PC's.

I've downloaded the Linux version of the Informix Client SDK and installed
it.  What happens next?  From looking at the documentation (which isn't too
clear), it looks as though I need to compile the ODBC libraries directly
into PHP.  How do I do that?  Which libraries should I use?

Could I use iODBC to act as a front end?  I used this on a different site
where I had Openlink ODBC installed.

Could I use Openlink ODBC clients to go across I-Net?

If anyone could help, I'd be most grateful.

Thanks in advance.

Regards,

Paul



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




[PHP-DB] Fatal Error

2001-09-22 Thread Paul Devine

Hello,

I was wondering if this means that my ISP doesnt support mysl commands in
php. They use php3.0.18 and apache server. I get the following message.

Fatal error: Call to unsupported or undefined function mysql_connect() in
/home/fantasy/public_html/phptest.php3 on line 2

when using this snippet of code

?php
$link = mysql_connect (localhost, fantasy, password)
or die (Could not connect);
print (Connected successfully);
mysql_close ($link);
?

Thanks

Paul Devine



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




Re: [PHP-DB] ghost server?

2001-09-10 Thread Paul Jongsma

Hello hex,

Monday, September 10, 2001, 8:40:16 PM, you wrote:

hPF hi.

hPF i menage quite popular internet wortal (http://hip-hop.pl) and I use mysql and
hPF php 4.0 as the main generator of all webpages.
hPF since few months every day i have some problems with the server (AMD Duron
hPF 700MHz, 256 Mb RAM, ABIT KT7-RAID, Intel Ether Express 100+). operating system
hPF is FreeBSD 4.3
hPF the internet provider is checked, fast and good. i know this because on this
hPF internet connection is linked another server (rather low traffic) and it works
hPF non-stop.

hPF this problem grow every day. the problem is that this server disapears for few
hPF minutes, and then it apears again. it happens only in hours of main usage (i
hPF know it from hourly satistics). when it apears it works rather fast. the problem
hPF is growing every month because our statistics go up. when the server stops none
hPF of the installed services works. and what is amazing there is no errors nor
hPF warnings in the logs.

It could be a lot of things; just some random things to check

mysqladmin extended-status

might give you an idea of things going on, doublecheck the uptime
value, is it the same as the uptime of the machine? sometimes mysql
crashes and restarts itself. It could take minutes before the
databaseserver is back. This could be your problem.

You can also check processes within myqsl with

mysqladmin processlist

Further the unix: is it tuned? FreeBSD out of the box is good but it
can be tuned quite a bit, I've run sites on similar hardware with
1000+ users hitting the server more or less at the same time with a
mysql based web-application. The box was tuned quite a bit but could
handle the load without any problems.

Doublecheck your application and database design, sometimes adding an
index can increase performance 100x.

If you need more info let me know...

Brgds


hPF i was wondering if its is because of mysql or other service installed on the
hPF server. has anyone the same problem in the past? what is the reason? please
hPF help.






-- 
Paul Jongsma 
WEBtic Internet Consultancy @ http://www.webtic.nl/

Change is inevitable, except from vending machines.


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




Re: [PHP-DB] Forms Question

2001-09-06 Thread Paul Gardiner

Hi there,

Take a look at the following snippet below. It is similar to what you're
looking for without having to bugger about duplicating loads of lines for
each store. Just add a new one to the array if required.

Best Regards,
- Paul -

select name=MonthSelected size=1
?php

  $MonthArr = array (
 January,
 February,
 March,
 April,
 May,
 June,
 July,
 August,
 September,
 October,
 November,
 December,
);

  reset($MonthArr);

  foreach ($MonthArr as $MonthName) {
echo option VALUE=\$MonthName\;
if ($MonthName == $MonthSelected) echo  selected;
echo ;
echo $MonthName;
  }

?
/select


- Original Message -
From: Steve Cayford [EMAIL PROTECTED]
To: Jeff Grossman [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, September 05, 2001 11:36 PM
Subject: Re: [PHP-DB] Forms Question



 On Wednesday, September 5, 2001, at 04:50  PM, Jeff Grossman wrote:

  Hello,
  Here is the code I have:
 
  while ($row=mysql_fetch_array($result)) {
 $store=$row[store];
 $jobdesc=$row[jobdesc];
  echo FORM METHOD=post ACTION=update.php;
  echo PStore:
Select NAME=\$store\
   option VALUE=\Signal Hill\Signal Hill
   option VALUE=\Reseda\Reseda
   option VALUE=\Orange\Orange
   option VALUE=\West Covina\West Covina
   option VALUE=\Riverside\Riverside
   option VALUE=\Norwalk\Norwalk
   option VALUE=\Fountain Valley\Fountain Valley
   option VALUE=\Pasadena\Pasadena
   option VALUE=\Redondo Beach\Redondo Beach
   option VALUE=\San Bernardino\San Bernardino
   option VALUE=\Kearny Mesa\Kearny Mesa
   option VALUE=\San Marcos\San Marcos
   option VALUE=\Chino\Chino
   option VALUE=\Coporate Office\Corporate Office
/select/P;
  echo PINPUT TYPE=text SIZE=35 NAME=\Jobdesc\
  VALUE=\$jobdesc\/P;
  echo pINPUT TYPE=submit VALUE=\submit\ LABEL=\Save
  Changes\/P;
  }
 
 
  Is want I am trying to do possible?  I want the value which is stored in
  $store to automatically fill in on the drop down list.  But, for some
  reason it is defaulting to the first option, and not using the value
  that is in the database.
 
  Can I use a drop down menu, or should I just go to radio buttons?
 
  Thanks,
  Jeff

 If I understand your question...

 In order to have your value preset in the drop down list you need
 indicate that with
 option value=\blahblah\ selectedblahblah

 What I've been using for this is a hash like this:

 while ($row=mysql_fetch_array($result)) {
 $selected = array();
 $selected[$row[store]] = selected;
 $store=$row[store];
 $jobdesc=$row[jobdesc];
 echo FORM METHOD=post ACTION=update.php;
 echo PStore:;
 echo Select NAME=NameOfVariableToBePosted
 echo   option VALUE=\Signal Hill\  . $selected[Signal
 Hill] . Signal Hill;
 echo   option VALUE=\Reseda\  . $selected[Reseda] .
 Reseda;
 ...etc, etc., etc.

 something along those lines, anyway. So, if $row[store] == Signal
 Hill, then $selected[Signal Hill] will be set to selected, while
 $selected[Reseda] and all the others will be blank.

 This is a very keen thing about php.

 -Steve


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



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




Re: [PHP-DB] PHP linux interbase Apache

2001-09-06 Thread Paul Cooper

On Thu, Sep 06, 2001 at 03:38:18PM +0100, Stephane MOREL wrote:
 Thank you for your answer
 after a glance on the net I have found I need interbase.so. This is not present
 on my disk do you how can I retrieve it
 steph

How and where did you intsall interbase - it's been a while so I forget. 
I think the rpm version installs itself in /opt/interbase (you can check 
with rpm -ql interbase). If that is the case then you need to configure 
with

./configure --with-apxs=/path/to/apxs --with-interbase=/opt/interbase 
--enable-track-vars

Paul

 Meir Kriheli a écrit :
 
  On Thursday 06 September 2001 13:31, Stephane MOREL wrote:
   Hi all
   I'm new on PHP. I've installed PHP interbase Apache correctly. But I
   would like to connect Interbase database through PHP. So I enable
   interbase support for php by doing this :
   ./configure --with-interbase --with-apache --enabled-track-vars
 
  if you compile with --with-apache, you'll have to recompile apache too. You
  can compile it as a shared module --with-apxs=path to your apxs.
 
  Note: you'll need Apache development stuff (Depends on your distro).
 
  Any way after running make install make sure you've restarted Apache.
 
   make
   make install
   Evreything works fine
   When I do this :
   ?
   $conn=ibase_connect(192.168.2.2:/opt/interbase/examples/employee.gdb,
   SYSDBA, masterkey);
   if (!$conn)
   { echo Access Denied!;
   exit; }
   ?
   my browser say :Call to undifined function :ibase_connect.
   I understood that I must enable the extension in php.ini. I think the
   extension was automatically added to my php.ini but I can not find any
   entry in php.ini for interbase.
   If someone could help
   TIA
  
   Steph
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
-
Paul Cooper |  Tel: 0121 331 7858
Senior Programmer and Database Engineer |  Fax: 0121 331 7859
UCEcom  |  mailto:[EMAIL PROTECTED]
University of Central England   |  http://www.ucecom.com
Birmingham, B4 7DX  |
-

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




Re: [PHP-DB] How can you hide database login passwd in yourscript?

2001-09-05 Thread Paul Burney

 That does not stop another php user fopen'ing your config file.

This is a point that needs to be stressed.  The other posts about keeping db
connection info outside of the web tree and naming the files .php are good
ones, but even with them, there can be major security problems on a shared
virtual host, which many / most hosting providers provide.

For example, a malicious user gets an account on a shared host with PHP
(probably Perl, too) installed.  They then do an fopen on the /etc/passwd
file to see which users are on the machine and where their directories are.
If shadow passwords aren't used, they also get the encrypted password.

With that knowledge they can use the standard PHP directory commands like
dir to get a listing of all the files in a user's home directory and then
they can fopen whichever one they'd like.

In these setups, the same user (nobody, www, etc.) has read access to all of
these files.  If it didn't, you script wouldn't work.  Once a user finds a
password for a mysql database, they can just:

DROP database_name

or

DELETE FROM table_name

Possible solutions:

1) Run your own server (not possible in many cases)

2) Run php in safe mode (something a hosting provider must do, will break
some/many apps)

3) Make sure that your mysql users have only the necessary permissions,
i.e., don't give the user insert/update/delete privs if they only need to
SELECT.

4) Don't store sensitive data in databases on shared servers.

5) Backup everything from databases regularly and hope you never really need
to use them.

Hope that helps.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] newbie needs to format time field

2001-09-05 Thread Paul Burney

on 9/5/01 9:22 PM, Eric J Schwinder at [EMAIL PROTECTED] wrote:

 thanks so much, I've gotten a lot from that page of the mySQL
 documentation...

Here's another one for you:

http://www.mysql.com/doc/S/E/SELECT.html

quote A SELECT expression may be given an alias using AS. /quote

So instead of:

 SELECT DATE_FORMAT(date,'%m/%d/%y') FROM ...

You could do this:

SELECT DATE_FORMAT(date,'%m/%d/%y') AS mydate FROM ...

 I tried using that query, but then I didn't know how to get the formatted
 date out of the array field in my PRINTF lines (what goes in the [  ]?)

Using the above code, the value you're looking for is mydate, i.e.,

echo $myrow['mydate'];

HTH.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] Random

2001-08-31 Thread Paul Burney

 according tho the description at
 http://www.mysql.com/doc/M/a/Mathematical_functions.html, that looks

 $result = mysql_db_query ($DBName,select * from Contacts order by rand()
 LIMIT 5 );
 Doesn't work at all. :(

What version of MySQL are you using?  I remember something about ordering by
rand() only working in 3.23.xx.  If you're using 3.22.xx, it won't work.

You could do something with mysql_data_seek() and the php mt_rand() function
if that's the case.  It would be klunky, but you could probably get it to
work.

Sincerely,

Paul Burney

+-+-+
| Paul Burney | P: 310.825.8365 |
| Webmaster  Programmer | E: [EMAIL PROTECTED]   |
| UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
+-+-+


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




Re: [PHP-DB] MySQL UPDATE problem

2001-08-30 Thread Paul Burney

on 8/30/01 4:06 PM, Malcolm White at [EMAIL PROTECTED] wrote:

 $query = UPDATE Groups SET GName=$new_name WHERE GID=$gid;

If the Gname field is a string type, there should probably be quotes around
it.

$query = 'UPDATE Groups SET GName=' . $new_name . ' WHERE GID=' . $gid;

HTH.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] Error making php with informix

2001-08-29 Thread Paul Gardiner

Hello again,

What version of Informix are you now running? Last time we spoke you were
only on 5. AFAIK you need at least ver 7

In the current version(4.0.6) of PHP the Informix libraries must be
specified in LIBS when compiling Apache. Jani has hopefully fixed this
problem for 4.0.7.  Have a look back to the last mail I sent you about a
month ago for more info.

Regards,
- Paul -

- Original Message -
From: Muciño Zúñiga Marco Antonio [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 28, 2001 7:28 PM
Subject: [PHP-DB] Error making php with informix


 Hi, I'm trying to install php-4.0.6 in my SCO Unix box but when I run the
 make command I get the next error:

 /bin/sh ../libtool --silent --mode=link gcc  -g -O2  -o
ibZend.la  -lifsql
 -lif
 asf -lifgen -lifos -lifgls -lnsl_s -lcrypt_i -lgen -lsocket -lnsl -lsuds
 -ltinfo
  -lprot -lx -ltinfo -lc -lphpifx -lifglx -lcrypt -lm -lsocket -lifsql
 -lifasf -l
 ifgen -lifos -lifgls -lnsl_s -lcrypt_i
/usr/lib/libgen.a -lsocket -lnsl -lm
 -lsu
 ds -ltinfo -lprot -lx -ltinfo -lm -lc /usr/informix/lib/esql/checkapi.o
 -lsocket
   zend_language_parser.lo zend_ini_parser.lo zend_alloc.lo zend_compile.lo
 zend_
 constants.lo zend_dynamic_array.lo zend_execute.lo zend_execute_API.lo
 zend_high
 light.lo zend_llist.lo zend_opcode.lo zend_operators.lo zend_ptr_stack.lo
 zend_s
 tack.lo zend_variables.lo zend.lo zend_API.lo zend_extensions.lo
 zend_hash.lo ze
 nd_list.lo zend_indent.lo zend_builtin_functions.lo zend_sprintf.lo
 zend_ini.lo
 libZend_c.la
 libtool: link: cannot build libtool library `libZend.la' from non-libtool
 object
 s: /usr/lib/libgen.a /usr/informix/lib/esql/checkapi.o
 make[1]: *** [libZend.la] Error 1
 make[1]: Leaving directory `/tmp/php-4.0.6/Zend'
 make: *** [all-recursive] Error 1

 Do you have any idea what I'm doing wrong? Thanx in advance.


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



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




Re: [PHP-DB] PHP/mySQL and INSERT statements

2001-08-28 Thread Paul Burney

on 8/27/01 11:32 PM, Pyran Firebrand at [EMAIL PROTECTED] wrote:

  $query = INSERT INTO rants VALUES (1, '$date', '$type', '$title',
 '$text');
  mysql_db_query($query, $db_link) or die (brProblem!);
 }

You should probably be specifying the database before the $query.  By the
way, use of the mysql_db_query function is now deprecated.  You may wish to
try:

mysql_select_db($database_name,$db_link);
mysql_query($query,$db_link);

 When I try to execute this, it doesn't add anything into the database, and
 prints out Problem!.  I have absolutely no idea why.  Can someone give me
 some direction here?  I would be eternally grateful for it.

The first step would be to echo the query and take a look at exactly what
you're asking the mysql server to do.

$query = INSERT INTO rants VALUES (1, '$date', '$type', '$title',
'$text');
echo $query;
exit;

If the query looks OK, you should try it via the command line mysql client
program to see what errors are reported.  The errors from the command line
are generally more descriptive than those from PHP.

Another thing to try is instead of dying with Problem!, try exiting with
mysql_error and/or mysql_errno, that is:

echo mysql_errno() , ': ' , mysql_error() , 'BR';

HTH.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




[PHP-DB] Oracle OCI/Client install without OUI?

2001-08-22 Thread Paul Blacquiere

Hi,

Does anybody have an idea on how I could install the oracle client/libraries
required to build PHP with OCI support without using the OUI.

The server is headless, and behind a firewalls, so X-Server is not an
option, it also has no local CD-Rom, just to add to the problem.

Platform := Solaris 8.

I will attempt installing the client onto a similar machine, and extracting
the components required to make a working client ?? but there must be a
better way.

Thanks in advance PaulB.


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




Re: [PHP-DB] mysql optional file - my.cnf

2001-08-17 Thread Paul Burney

on 8/17/01 8:35 AM, Fai ([EMAIL PROTECTED]) wrote:

 Does any body know how to prevent mysql server looking for user specific
 optional file ( .my.cnf)? So, user cannot put the optional file (.my.cnf) in
 his home directory to affect the mysql server behaviour.

Please try the MySQL list since this is a PHP / Database discussion list.
See mysql.com for more information.

Sincerely,

Paul Burney

+-+-+
| Paul Burney | P: 310.825.8365 |
| Webmaster  Programmer | E: [EMAIL PROTECTED]   |
| UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
+-+-+


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




Re: [PHP-DB] MySQL Modules and multiple database

2001-08-13 Thread Paul Burney

on 8/13/01 1:56 PM, Szii ([EMAIL PROTECTED]) wrote:

 Opening multiple databases on the same database machine
 seems unsupported.  While you CAN do it, it has a tendency
 to reuse the last connection even in lieu of a specific database.
 Right now we're using mysql_db_query() to get around it, but
 with that becoming deprecated, we need to find anothe solution.

Before each query (from a different database), you can call the function;

mysql_select_db($database_name, $connection_id)

You can also specify the connection id for your queries:

mysql_query($query, $connection_id)

Just make sure that you select the db before each query otherwise a query
will use the last selected database.

Sincerely,

Paul Burney

+-+-+
| Paul Burney | P: 310.825.8365 |
| Webmaster  Programmer | E: [EMAIL PROTECTED]   |
| UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
+-+-+


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




Re: [PHP-DB] Submit forms

2001-08-10 Thread Paul Burney

on 8/10/01 7:50 AM, Ian Grant at [EMAIL PROTECTED] wrote:

 I've got a simply search form, on my site using PHP and MySQL.
 It writes a SELECT query  using WHERE (Field LIKE '%thingy%') where thingy
 is the word entered in the form. It works fine if the submit button is
 pressed, but if you press return after typing the word, instead, it fails
 and writes nothing for the query, so it ends up like WHERE ()

Browsers differ on how they interpret the hitting of the return key and
which fields get submitted.  I'd guess you have an input type='submit'
name='submit' value='yes' type field and you are checking isset($submit).
Some browsers (Netscape on the Mac, for example) won't submit the name-value
pair associated with the button.

One solution is to do this instead:

input type=hidden name=submit value=yes
input type=submit value=Search!
 
No matter how the form is submitted, the submit variable will be set to yes.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] mysql_fetch_array missing first record

2001-08-07 Thread Paul Burney

on 8/7/01 1:41 PM, Jamie ([EMAIL PROTECTED]) wrote:

 while ($previews = mysql_fetch_array($result) {
   code to display record here...
 }
 
 For some reason it refuses to display the very first record in the table.
 Why is this and how can I get round it?

Are you calling mysql_fetch_array before this in your code, perhaps to see
if there is a result?  If so, that's the problem.  Each call to
mysql_fetch_array (mysql_fetch_row) increments the array pointer.

If that isn't your problem, please post more of the code so that we can make
a better diagnosis.

Sincerely,

Paul Burney

+-+-+
| Paul Burney | P: 310.825.8365 |
| Webmaster  Programmer | E: [EMAIL PROTECTED]   |
| UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
+-+-+


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




Re: [PHP-DB] mysql_fetch_array missing first record

2001-08-07 Thread Paul DuBois

At 9:41 PM +0100 8/7/01, Jamie wrote:
Hi,

I have this code to display records from a table by reading them into an
array:

while ($previews = mysql_fetch_array($result) {
 code to display record here...
}

For some reason it refuses to display the very first record in the table.

The first record in the table, or the first record in the result set?


Why is this and how can I get round it?

Hard to say without seeing the surrounding context.



Thanks.

Jamie Saunders


-- 
Paul DuBois, [EMAIL PROTECTED]

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




Re: [PHP-DB] auto fill field with value from another

2001-08-07 Thread Paul DuBois

At 3:38 PM -0400 8/3/01, bill wrote:
Is there a way to have a field in a MySQL table automatically be filled
whenever that row is created or updated with the value of another field
in the same table?

Is there a way to have it filled with a calculation based on another
field?

No.

The MySQL manual says default values must be constants:

http://www.mysql.com/doc/C/R/CREATE_TABLE.html


thanks,

bill hollett


-- 
Paul DuBois, [EMAIL PROTECTED]

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




Re: [PHP-DB] Query on Oracle Views

2001-08-06 Thread Paul Burney

on 8/6/01 5:33 PM, Rankin, Randy at [EMAIL PROTECTED] wrote:

 When I execute this query, the server returns the following error.
 Warning: OCIStmtExecute: ORA-00942: table or view does not exist in
 /usr/local/apache/htdocs/oracle/oraprod.php on line 17
 
 My suspicion is that PHP thinks that the '$' in the table name is the
 beginning of a variable. Does anyone know how to get around this so that I
 can execute a query with a table name like v$instance?

Sure.  Either use single quotes:

$query = 'SELECT instance_name, host_name FROM v$instance';

Or escape the $:

$query = SELECT instance_name, host_name FROM v\$instance;

HTH.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] Grouping functions inside WHERE clause - may or not

2001-08-04 Thread Paul DuBois

At 6:59 PM +0300 8/4/01, Ventsyslav Vassilev wrote:
Hi,
My simple question is:
May i use grouping functions in the WHERE clause of a SQL query in mySQL?

For example, this failed to work:
SELECT date_field FROM tablename WHERE date_filed BETWEEN MIN(date_field)
AND MAX(date_field);

In the mySQL manual i red the following into Functions to use in SELECT and
WHERE clauses/Comparision operators section:

If expr is a TIMESTAMP, DATE, or DATETIME column, MIN() and MAX() are
formatted to the same format if they are constants.

What this means?

may i use min()/max() into WHERE or not?

1) The WHERE clause is used to determine which records to select.
2) MIN() and MAX() are determined based on the values of the selected
records.

You draw the conclusion.

However, you may be able to use user-defined variables to do what you
want.  Execute a couple of queries:

SELECT @dmin := MIN(date_field), @dmax := MAX(date_field) FROM tablename;
SELECT date_field FROM tablename WHERE date_field BETWEEN @dmin and @dmax;


By the way, this is a PHP list.  What's your PHP question?


Pls help!
--

Ventsyslav Vassilev
Comel Soft Multimedia
Sofia, Bulgaria
ICQ UIN: 11199819
e-mail: [EMAIL PROTECTED]


-- 
Paul DuBois, [EMAIL PROTECTED]

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




[PHP-DB] odbc problems - cannot connect to MS Access db

2001-08-04 Thread Paul Fenton

Please help

I am trying to get PHP to connect to MS Access db on a win2000 server, but
only getting following errors:


Warning: SQL error: , SQL state 0 in SQLConnect in
d:\websites\~nit\hello.php on line 7

Warning: Supplied argument is not a valid ODBC-Link resource in
d:\websites\~nit\hello.php on line 9

Warning: Supplied argument is not a valid ODBC result resource in
d:\websites\~nit\hello.php on line 12


Warning: Supplied argument is not a valid ODBC result resource in
d:\websites\~nit\hello.php on line 14

Warning: Supplied argument is not a valid ODBC-Link resource in
d:\websites\~nit\hello.php on line 25

I have set up this database in odbc datasources in windows (Both UserDSN and
SystemDSN) and am able to access it perfectly using JSP, but will not work
with PHP.

This is the PHP code I'm using:

html

body
  p align=center
  ?PHP

$Link = odbc_connect(Test, Admin, x);

$Result = odbc_exec ($Link, SELECT * FROM test);

 print(odbc_result($Result,1) . br);

while (odbc_fetch_row($Result) != 0){

  print(odbc_result($Result,1) . br);
}

odbc_close($Link);

  ?
  /p
/body

/html

The strange thing is that I have actually got all this working perfectly
using apache, PHP on a win98 machine.

I'm only new to PHP so any assistance or suggestions would be greatfully
accepted.

Thanks



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




Re: [PHP-DB] PHP and Informix installation

2001-07-27 Thread Paul Gardiner

Hi,

To be honest I don't know if PHP will work with version 5.x of Informix. I
think it must be 7.x. At least that's for the SE version.

In case I'm wrong for On-Line you can have a go but you'll have to specify
the libs manually when compiling Apache.

If you run esql -libs this will list the libs you need. I have shown the
ones for my machine but just check your own and put them in IFX_LIBS as like
something below:

# get these by running esql -libs at the prompt
IFX_LIBS=-lifsql -lifasf -lifgen -lifos -lifgls -lnsl_s -lcrypt_i \
/usr/lib/libgen.a -lsocket -lnsl -lm -lsuds -ltinfo -lprot -lx \
-ltinfo -lm -lc /usr/informix/lib/esql/checkapi.o -lifglx

# Add any extra libs in here if required
LIBS=$IFX_LIBS

export LIBS

./configure --prefix=$APACHE_DIR \
--activate-module=src/modules/php4/libphp4.a

Regards,
- Paul -

- Original Message -
From: Muciño Zúñiga Marco Antonio [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 26, 2001 6:35 PM
Subject: [PHP-DB] PHP and Informix installation


Hi, I installed php y my UNIX SCO Openserver and it works fine. Now, in the
same server is installed the Informix Online 5.10. I want to access the
Informix databases then I run the next commands successfully:

cd php-4.0.6
./configure --with-apache=../apache_1.3.20 --enable-track-vars
--with-informix=/usr/informix
make
make install
cd ../apache_1.3.20
./configure --prefix=/usr/internet/apache
--activate-module=src/modules/php4/libphp4.a

All is OK until the last command (./configure ...) I get the error messages:

# ./configure --prefix=/usr/internet/apache
--activate-module=src/modules/php4/libphp4.a

Configuring for Apache, Version 1.3.20

 + using installation path layout: Apache (config.layout)

 + activated php4 module (modules/php4/libphp4.a)

Creating Makefile

Creating Configuration.apaci in src

Creating Makefile in src

 + configured for SCO 5 platform

 + setting C compiler to gcc

 + setting C pre-processor to gcc -E

 + checking for system header files

 + adding selected modules

o php4_module uses ConfigStart/End

 + checking sizeof various data types

 + doing sanity check on compiler and options

** A test compilation with your Makefile configuration

** failed.  The below error output from the compilation

** test will give you an idea what is failing. Note that

** Apache requires an ANSI C Compiler, such as gcc.



cd ..; gcc  -DSCO5 -I/tmp/php-4.0.6 -I/tmp/php-4.0.6/main
-I/tmp/php-4.0.6/main
-I/tmp/php-4.0.6/Zend -I/tmp/php-4.0.6/Zend -I/tmp/php-4.0.6/TSRM
-I/tmp/php-4.0
.6/TSRM -I/tmp/php-4.0.6 -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED
`./apaci`
 -o helpers/dummy helpers/dummy.c   -L/usr/informix/lib
-L/usr/informix/lib/
esql -L/tmp/php-4.0.6/ext/informix  -L/usr/informix/lib
-L/usr/informix/lib/esql
 -L/tmp/php-4.0.6/ext/informix -Lmodules/php4 -L../modules/php4
-L../../modules/
php4 -lmodphp4   -lifsql -lifasf -lifgen -lifos -lifgls -lnsl_s -lcrypt_i
-lgen
-lsocket -lnsl -lsuds -ltinfo -lprot -lx -ltinfo -lc -lphpifx -lifglx
-lcrypt -l
m -lsocket  -lsocket   -lsocket -lmalloc -lprot -ltinfo -lx -lm

Undefined   first referenced

 symbol in file

getspnam/usr/informix/lib/esql/libifos.so

helpers/dummy: fatal error: Symbol referencing errors. No output written to
help
ers/dummy

make: *** [dummy] Error 1

 Error Output for sanity check 

= End of Error Report =



 Aborting!




Looks like the library libifos.so is wrong, does anyone have an idea what's
going on? Thanks in advance.

Marco Muciño


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



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




Re: [PHP-DB] mysql query problem

2001-07-26 Thread Paul Burney

on 7/26/01 11:11 AM, Steve Fitzgerald ([EMAIL PROTECTED]) wrote:

 ran the query in the MySQL client and got the ERROR 1054: Unknown column
 '$ContactID' in 'where clause'.  I know the column ContactID exists.

Of course it did.  It can't find the text $ContactID in the table.  Try
putting in a number (1,2,3, etc.) and see if it works.

If it does, try echo'ing out the $ContactID and the $sql to the screen.  See
if $ContactID really is set and then try the output of $sql in the MySQL
client.

?php

echo 'ContactID is: ' , $ContactID, 'br';
 
$sql=SELECT * FROM contacts WHERE ContactID='$ContactID';

echo 'SQL query is: ' , $sql, 'br';

$result = mysql_query($sql,$db);

printf(%s\n, mysql_result($result,FirstName));

printf(%sbr\n, mysql_result($result,LastName));

?

Hope that helps.

Sincerely,

Paul Burney

+-+-+
| Paul Burney | P: 310.825.8365 |
| Webmaster  Programmer | E: [EMAIL PROTECTED]   |
| UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
+-+-+


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




RE: [PHP-DB] WHERE field = str

2001-07-25 Thread Paul DuBois

At 2:55 PM -0400 7/25/01, Matthew Loff wrote:
Certainly not in the PHP manual, and LIKE isn't really covered in the
MySQL manual either...

Of course it is.

http://www.mysql.com/doc/S/t/String_comparison_functions.html



Here's a good page with an intro to SQL queries:
http://developer.ecorp.net/sqltut.htm

--Matt


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 2:46 PM
To: PHP DataBase-List
Subject: Re: [PHP-DB] WHERE field = str


Thanks Chris
I searched everything I could think of. Where should I have found this
is the manual? Dave


|  I am trying to find a str within a field using a select statement
|  like SELECT * FROM tablename WHERE fieldname has the string within
|  it Is there a way to do this?
|
| WHERE fieldname LIKE %$string%
|
| Chris
|

[EMAIL PROTECTED]

SeaPortNetHosting: Reliable Web Hosting
Plans from $17.95 www.yourname.com
http://www.SeaPortNet.com/
1(209)551-7028


-- 
Paul DuBois, [EMAIL PROTECTED]

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




Re: [PHP-DB] Problem with my first script

2001-07-24 Thread Paul Burney

on 6/24/01 7:23 PM, Fernando Gonzalez at [EMAIL PROTECTED] wrote:

 I have eliminate the space but still the same message.

 $myrow=mysql_fetch_array ($result);

 Fatal error: Call to undefined function: array() in
 /home/fergonza/mod_php4/index.php on line 18

I wonder if somehow you have an invisible control character between the
mysql_fetch_ and the array part.  Try deleting the line and retyping:

$myrow = mysql_fetch_array($result);

Hope that helps.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




[PHP-DB] mysql_[p]connect() and mysql_error()/mysql_errno()

2001-07-23 Thread Paul DuBois

I see in the PHP 4.0.6 release notes that mysql_error() and mysql_errno()
have been fixed so that you can get error information from them when
a connect call fails. (Previously they worked only after successfully
establishing a connection, so that you had to use $php_errormsg with
track_errors turned on to get connection error information.)

I want to write connection code that takes advantage of this, so that
it uses the MySQL error functions if they're the fixed versions, and
falls back to $php_errormsg otherwise.  Does the following look reasonable?

if (!($conn_id = @mysql_connect ($host, $user, $password)))
{
 # If mysql_errno()/mysql_error() work for failed connections, use
 # them (invoke with no arguments). Otherwise, use $php_errormsg.
 if (mysql_errno ())
 {
 die (sprintf (Cannot connect to database server: %s (%d)\n,
 htmlspecialchars (mysql_error ()),
 mysql_errno ()));
 }
 else
 {
 die (Cannot connect to database server: 
 . htmlspecialchars ($php_errormsg) . \n);
 }
}


I'm assuming that the proper way to invoke mysql_error()/mysql_errno()
after a failed connection is with *no* argument, because when a failure
occurs $conn_id won't have any reasonable value and shouldn't be passed
to those functions.

-- 
Paul DuBois, [EMAIL PROTECTED]

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




Re: [PHP-DB] Counting Number of Instances in a One2ManyRelationships

2001-07-23 Thread Paul Burney

on 7/23/01 6:53 PM, Mike Gifford at [EMAIL PROTECTED] wrote:

 I'd like a simple query to determine how MANY books in a database are released
 by A publisher.  This shouldn't be a big deal, but I've looked at a number of
 solutions and am coming up short.  MySQL is being accessed via phplib, but I'm
 sure that it's just how I'm expressing the general MySQL query.

Maybe I'm not quite getting it, but how about:

SELECT COUNT(bibID) FROM bookDB WHERE publisherID='$your_publisher_id';

 The bookID  publisherID are both listed in the bookDB.  I just want a query
 which will go through the database and return the publisherID and a count of
 the number of books.

You can do a group by to get them all at once:

SELECT COUNT(*) AS book_count, publisherID FROM bookDB GROUP BY publisherID;

Then use your favorite mysql_fetch_*** and access them.

Hope that helps.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] Authomatic Sorting

2001-07-04 Thread Paul Burney

on 7/4/01 1:50 PM, Wilmar Pérez at [EMAIL PROTECTED] wrote:

 I've got a table with an autoincrement field which is the registry's ID,
 everything goes well until I delete any registry.  MySQL doesn't re-sorts
 the information.  That is, I have the following:

snip

Just add an ORDER BY clause to your query.  That is, if you want to sort
by reg_id, append ORDER BY reg_id.  You can also add a DESC keyword to put
them in reverse order.

HTH.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




[PHP-DB] PhpMyAdmin phpPgAdmin Security Issues

2001-07-02 Thread Paul Burney

I don't know how many of you on this list are also on Bugtraq, but there
were some *very* interesting posts there this morning by Shaun Clowes.  You
can see them at:

http://www.securereality.com.au/archives.html

The relevant links to look at are A Study in Scarlet:
http://www.securereality.com.au/studyinscarlet.txt

And:

(SRPRE1) phpMyAdmin 2.1.0 and phpPgAdmin 2.2.1
http://www.securereality.com.au/srpre1.html

I imagine that many on this list do use phpMyAdmin or phpPgAdmin so this
post is very important.

Basically, depending on configuration, any user on the web can use
phpMyAdmin to view sensitive files (/etc/passwd), etc.  There is a patch
available.

The Study in Scarlet goes into details about other common PHP security
breaches, and a little about how to avoid them.  The problems aren't *so*
bad if you're running your own server and access is only given to a few
trusted developers.  You could probably retrain everyone to use
$HTTP_GET_VARS, etc.

However, there could be a multitude of problems on hosts with multiple
virtual users.  For example, the above exploit could be used to get a list
of the users and home directories in /etc/passwd and then a malicious user
could view directory listings and file contents from another user's
directory.  That could lead to database passwords escaping and other local
users modifying your data.  And that's only the tip of the iceberg.

I look forward to seeing Rasmus, Andi, Zeev, Stig etc. respond to this.

Sincerely,

Paul Burney

+-+-+
| Paul Burney | P: 310.825.8365 |
| Webmaster  Programmer | E: [EMAIL PROTECTED]   |
| UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
+-+-+


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




[PHP-DB] PEAR DB, prepare(), and placeholders

2001-06-30 Thread Paul DuBois

Question 1:

When using PEAR DB, are you supposed to be able to use a prepared statement
multiple times?  I would suppose yes, but when I execute the code below,
the second use of the prepared statement results in an error:

$stmt = $conn-prepare (INSERT INTO abc (i, c) VALUES (?, ?));
if (DB::isError ($stmt))
 die (prepare() failed:  . $stmt-getMessage () . \n);

$result = $conn-execute ($stmt, array (4, d));
if (DB::isError ($result))
 die (execute() failed:  . $result-getMessage () . \n);

$result = $conn-execute ($stmt, array (5, e));
if (DB::isError ($result))
 die (execute() 2 failed:  . $result-getMessage () . \n);


The error message from the script is:

execute() 2 failed: DB Error: syntax error

I'm using MySQL. The queries that show up in the MySQL log file are:

23304 Query   INSERT INTO abc (i, c) VALUES ('4', 'd')
23304 Query   Object

Looks to me like $stmt is being munged?

Question 2:

How to you bind a NULL value to a placeholder?  In DBI, you use undef
to stick a NULL into a query; in PEAR DB, I tried both null and an unset
variable, with the result that an empty string was placed into the query
string in both cases.

-- 
Paul DuBois, [EMAIL PROTECTED]

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




Re: [PHP-DB] MySQL connection: Change on syntaxis?

2001-06-29 Thread Paul DuBois

At 9:05 AM +0100 6/22/01, Russ Michell wrote:
   Is this a new use of the function mysql_num_rows?
No!.


It's not a change in syntax, but it is a change in PHP's behavior.
In PHP 4, mysql_num_rows() and mysql_num_fields() will issue error
messages if the argument is not a result set.  In PHP 3 they didn't
seem to do this.  This may account for the new error messages after
updating PHP.


You can use the @ to 'suppress error messages' that may reveal
delicate information to users such as paths to directories on your
server. It can be preppended to almost any php function likely to
result in an error, if used incorrectly.

Russ

On Thu, 21 Jun 2001 23:30:03 +0200 Tom=?ISO-8859-1?B?4XMgR2FyY+0=?=a
Ferrari [EMAIL PROTECTED] wrote:

  Hello,

  I updated php to version 4.0.5 and MySQL to version 2.32.39, had errors
  on lines like this:

  $rows = mysql_num_rows($result);

  and noticed that this is a solution:

  $rows = @mysql_num_rows($result);

  Is this a new use of the function mysql_num_rows?

  +-- --+
 Tom·s GarcÌa FerrariBigital
 http://bigital.com/ +--
  --+



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


#---#

   Believe nothing - consider everything

   Russ Michell
   Anglia Polytechnic University Webteam

   e: [EMAIL PROTECTED]
   w: www.apu.ac.uk/webteam
   t: +44 (0)1223 363271 x 2331

   www.theruss.com

#---#


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


--
Paul DuBois, [EMAIL PROTECTED]

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




Re: [PHP-DB] MySQL Error???

2001-06-28 Thread Paul Burney

on 6/27/01 9:24 AM, Brian Grayless at [EMAIL PROTECTED] wrote:

 1062: Duplicate entry '127' for key 1
 I wrote a great bookmark management program that works fine, but everytime I
 insert bookmarks, I insert somewhere over 120 and I start getting this
 error, and it won't add them anymore.  Any suggestions???

It looks like you set your key column as a TINYINT type rather than say, an
INT.  Try ALTER'ing that column type to INT and see if it works.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] php/mysql horizontal listing query

2001-06-27 Thread Paul Burney

on 6/26/01 10:43 AM, Matt Nigh at [EMAIL PROTECTED] wrote:

 I need a section of a record label site with a releases section listed
 horizontally but here's the twist: after every 4 releases, I want the
 releases to move to the next columns below.
 
 ex. 
 release#1, release#2, release#3, release#4
 release#5, release#6

Basically you need to use the modulus operator.

Here's a rough example (untested):

?php
// set number of rows
$n = 4;

// initialize cell count
$c = 0;

// start table code (omitted)
echo 'tr';

// perform your query (omitted)
while ($row = mysql_fetch_array($query,$conn)) {

// make a new row if we reached the end of one
// but don't do it for the first row.
if ($c % $n == 0  $c = $n) {
echo '/trtr';
}

echo 'td';
// spit out all your mysql fields (omitted)
echo '/td';

// increment your cellcounter;
$c++;

}

// make sure you don't have a malformed table
while ($c % $n != 0) {
echo 'tdnbsp;/td';
$c++;
}

echo '/tr';
// end table code (omitted)

?

Hope that helps.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] Is MySQL in 4.0.6?

2001-06-26 Thread Paul Burney

on 6/25/01 3:46 PM, Adam Lundrigan at [EMAIL PROTECTED] wrote:

 Is MySQL included in the 406kb version of PHP 4.0.6?
 When I try to connect to MySQL (after adding localhost  paswords to
 php.ini) using this version it says:
 Warning: Can't connect to MySQL server on 'localhost' (10061) in
 mysql_local_test.php on line 2
 
 From what i've heard, MySQL is included in PHPbut why doesn't the
 connect work if it is included?

Though I haven't checked in version 4.0.6, typically MySQL *support* is
included with PHP.  That entails the necessary MySQL header files so that
PHP can compile with MySQL support.

You still need to download and install MySQL on the machine.  You can find
packages and more information at:

http://www.mysql.com/

Hope that helps.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] Is MySQL in 4.0.6?

2001-06-26 Thread Paul DuBois

At 8:16 PM -0230 6/25/01, Adam Lundrigan wrote:
Is MySQL included in the 406kb version of PHP 4.0.6?
When I try to connect to MySQL (after adding localhost  paswords to 
php.ini) using this version it says:
Warning: Can't connect to MySQL server on 'localhost' (10061) in 
mysql_local_test.php on line 2

From what i've heard, MySQL is included in PHPbut why doesn't 
the connect work if it is included?

The client library is included (if you build with --with-mysql), but
you have to be running a server somewhere that you can connect to.


-Adam Lundrigan
  CEO, VPU
  http://www.vpu-virtual.com/

  ICQ # 73617446
  [EMAIL PROTECTED]




-- 
Paul DuBois, [EMAIL PROTECTED]

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




Re: [PHP-DB] MySQL connection: Change on syntaxis?

2001-06-22 Thread Paul Burney

on 6/21/01 2:30 PM, Tomás García Ferrari at [EMAIL PROTECTED] wrote:

 I updated php to version 4.0.5 and MySQL to version 2.32.39, had errors on
 lines like this:
 
   $rows = mysql_num_rows($result);
 
 and noticed that this is a solution:
 
   $rows = @mysql_num_rows($result);
 
 Is this a new use of the function mysql_num_rows?

What are the error messages you get?  The @ symbol suppresses warning
messages being sent to the browser so it isn't fixing whatever the real
problem is.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] Informix Question (Still need help,please)

2001-06-22 Thread Paul Burney

on 6/21/01 2:23 PM, wflow at [EMAIL PROTECTED] wrote:

 What I want to do is create another query from some of the data from another
 one. The question is how do I take the data I get back from my first query
 and put that into variables so I can build my second query. The example I
 have in mind is:
 
 I a do a select tracknum,orderdate,ordertotal,status,shipdate from orders
 where tracknum = '$trknum' and I want the data returned into vars: like
 orderdate = $orderdate so I can create a new query like: select * from
 shipping where orderdate = '$orderdate'.

 does NOT return an enumerated array, as the top line of the page states. It
 ONLY returns an associative array.
 If there was an ifx_fetch_array like the one for MySQL, I would not have to
 even post this question.

Please Note:  I don't use Informix, but the following is an educated guess.

Even though it isn't an enumerated array, you should be able to get the
value using the name of the key.  For example, to set your new query, you
would have something like:

/* DB Connect stuff precedes this as in example on:
http://php.net/manual/en/function.ifx-fetch-row.php */

while ifx_fetch_row($rid) {

$my_new_query =
'SELECT * FROM shipping WHERE orderdate = ' . $row['orderdate'] . '';

/* Now, take that query and do something with it.  Call ifx_query or
 something.*/

}

You could also just go through all the results in a similar fashion and set:

$orderdate = $row['orderdate'];
$ordertotal = $row['ordertotal'];

Hope that helps.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




Re: [PHP-DB] Informix Question (Still need help,please)

2001-06-22 Thread Paul Gardiner

Hi,

Have a try with something like this. Not tested and it's Friday ;o)

$connid = ifx_connect(blah,blah,blah) or
  die(An error occurred connecting to database);

$Query = SELECT tracknum,orderdate,ordertotal,status,shipdate .
FROM orders .
WHERE tracknum = '$trknum' ;

$rid = ifx_query($Query, $connid, IFX_SCROLL) or
 die(An error occurred querying database);

$row = ifx_fetch_row($rid, NEXT);

$orderdate = $row['orderdate'];

$Query = SELECT stuff .
FROM somewhere .
WHERE orderdate = '$orderdate' ;


$rid = ifx_query($Query, $connid, IFX_SCROLL) or
 die(An error occurred querying database);

@ifx_htmltbl_result($rid,border=1);

ifx_free_result ($rid);

ifx_close($connid);

Regards,
- Paul -

- Original Message -
From: wflow [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 21, 2001 10:23 PM
Subject: Re: [PHP-DB] Informix Question (Still need help,please)


 Chris,

 Thanks for the advice, of course I already did rtfm and the
ifx_fetch_rows
 entry did not really help me. It, in fact

 does NOT return an enumerated array, as the top line of the page states.
It
 ONLY returns an associative array.
 If there was an ifx_fetch_array like the one for MySQL, I would not have
to
 even post this question.

 I only did post the question, because I needed help and figured I would
ask
 the experts, but all I got was somebody who says rtfm and most likely
did
 not read or understand my question, so, thanks a lot.



 B

 Christian Haul [EMAIL PROTECTED] wrote in message
 9gsg0u$6nf$[EMAIL PROTECTED]">news:9gsg0u$6nf$[EMAIL PROTECTED]...
  wflow [EMAIL PROTECTED] wrote:
   Hi All,
 
   What I want to do is create another query from some of the data from
 another
   one. The question is how do I take the data I get back from my first
 query
   and put that into variables so I can build my second query. The
example
 I
   have in mind is:
 
   I a do a select tracknum,orderdate,ordertotal,status,shipdate from
 orders
   where tracknum = '$trknum' and I want the data returned into vars:
like
   orderdate = $orderdate so I can create a new query like: select * from
   shipping where orderdate = '$orderdate'.
 
   @ifx_htmltbl_result($sql_result,border=1);
 
  You might want to consider reading the php manual, especially the part
on
 functions
  and even more the one on informix functions. There you'll find a
function
  called ifx_fetch_row.
 
  Chris.
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



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




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




Re: [PHP-DB] submitbutton/imagebutton

2001-06-22 Thread Paul Burney

on 6/22/01 6:10 AM, Jan de Koster at [EMAIL PROTECTED] wrote:

 I'm kind of new to php so there may be an obvious answer but I can't
 find it for the moment.

Look at the PHP FAQ, it's a great place to start:

http://php.net/FAQ.php

 In pure HTML there is of course no problem, the image is still used as a
 submit button but... the submit type is being passed on to a php script
 ( ...if ($submit) {...) that makes a qeary to a mysql database. When I
 change the type=submit to type=image the script doesn't pick up the
 submit value anymore, so nothing happens.

quote

7.13. I'm trying to use an input type=image tag, but the $foo.x and
$foo.y variables aren't available. Where are they?
When submitting a form, it is possible to use an image instead of the
standard submit button with a tag like:

input type=image SRC=image.gif NAME=foo
When the user clicks somewhere on the image, the accompanying form will be
transmitted to the server with two additional variables: foo.x and foo.y.

Because $foo.x and $foo.y are invalid variable names in PHP, they are
automagically converted to $foo_x and $foo_y. That is, the periods are
replaced with underscores.

/quote

So basically, instead of checking for $submit, do something like:

... if (isset($submit_x)) { ...

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



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




[PHP-DB] newbie: Trying to select a database in php

2001-06-20 Thread Paul Lockyer

Im using win2k and php to retrieve and dipslay database records, however whenever the 
page is loaded in a browser I get the following error (the line in question is in bold)

Fatal error: Call to undefined function: msql_select_db() in 
D:\ASP\test\php\default.php on line 18

The code I am using is below

?php

$connect = mysql_connect();

if(!$connect){
echo Could not etsablish connection to mySQL!;
exit;
}

$database = dvd_listings;

$dbb = msql_select_db($database,$connect) or die(Unable to select Database!); 

$sql = SELECT * FROM dvd_main;

$sql_result = mysql_query($sql,$connect);

echo table border=1;
echo trtdDVD Title/td/tr;

while($row = mysql_fetch_array($sql_result)){

$title = $row[main_title];
echo trtd$title/td/tr;

}

echo /table;

mysql_free_result($sql_result);
mysql_close($connection);
?

Any help would be appreciated



Re: [PHP-DB] Error MSG -410 while executing a select with ifx_query on a informix database on linux

2001-05-22 Thread Paul Gardiner

Hi Robert,

isql comes from (I)nformix (S)trutured (Q)uery (L)anguage. It's similar to
your sql-editor. I use the SE Database engine and not the Dynamic Server
like yourself. Whether this has anything to do with it I don't know but I
did run your code on my server just to make sure it ran properly and I
hadn't missed something. Obviously, changing the database connection and
select field and table.

Can you post the exact output of the page, not the html source?

Regards,
- Paul -

- Original Message -
From: Robert Hennig [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 22, 2001 3:40 PM
Subject: Re: [PHP-DB] Error MSG -410 while executing a select with ifx_query
on a informix database on linux


 Hi Paul,

 thanks for your fast reply. Maybe you could help me again :-) We are
working
 a lot with informix, so we thought to know every Programm, but isql is
 completely unknown. Is this a special programm?

 We have executed this select with a sql-editor on the server also as with
 dbaccess, on both it works.

 Thanks

 Robert

 Paul Gardiner [EMAIL PROTECTED] schrieb im Newsbeitrag
 001201c0e2ca$730d0c40$0200a8c0@PDG">news:001201c0e2ca$730d0c40$0200a8c0@PDG...
  Hi Robert,
 
  Your test code is correct although you could do with an
 ifx_close($conn_id);
  at the end.
 
  Have you tried running isql(assuming you've got it) and just trying to
run
  the query from there?
 
  Regards,
  - Paul -




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




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




Re: [PHP-DB] php-notepad

2001-05-19 Thread Paul Campbell

Quanta Plus

http://quanta.soundforge.net

Web Developement Enviroment

My choice.

On Saturday 19 May 2001 03:55, John Lim wrote:
 Visit  http://php.weblogs.com/editors for a list of editors.

 Sharmad Naik [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  Please tell me an editor for Linux

-- 
Paul Campbell
http://www.cmm.uklinux.net/
mailto:[EMAIL PROTECTED]
[EMAIL PROTECTED]

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




Re: [PHP-DB] newbie MySQL question

2001-05-19 Thread Paul Campbell

 $result = mysql_query(select * from shows);
Change to
 $result = mysql_query(select * from shows ORDER BY date DESC);


On Saturday 19 May 2001 21:45, Matt Nigh wrote:
 hi, i'm building a website right now with a shows page on it which will
 scroll horizontally in a window. i have each show listed in a table called
 shows (db is called almavale_board) with the following fields:

 id - bandplaying - venue - date - time - cover - description


 what i need to do is have the shows listed by date, having the latest date
 listed first. here's the code i have presently:


 table bgcolor=white cellpadding=0 cellspacing=0 border=0tr
 ?php
 $link = mysql_connect(localhost,almavale,violet);
 if(!$link) die (Could not connect to MySQL!);
 mysql_select_db(almavale_board,$link);
 $result = mysql_query(select * from shows);
 $num = mysql_numrows($result);
 for($x=0;$x$num;$x++) {
 $row = mysql_fetch_object($result);
 print td valign=toptable width=200 bgcolor=white cellpadding=4
 cellspacing=4 border=0trtd bgcolor=white valign=topfont face=verdana
 size=1
 b$row-bandplaying/bbr$row-venuebr$row-datebr$row-timebr$row
-

 coverbr$row-descriptionbrbr/font/td/tr/table

 /td
 ;
 }
 mysql_close($link);
 ?
 /tr/table



 oh and the date is in this format : Month-Day-,Year (ex. May 19, 2001)

 if anyone can help me out on this at all (or has any questions about my
 problem), please reply to this post, i'd be very appreciative.




 Thanks,

 Matt

-- 
Paul Campbell
http://www.cmm.uklinux.net/
mailto:[EMAIL PROTECTED]
[EMAIL PROTECTED]

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




[PHP-DB] php notepad

2001-05-18 Thread Paul Shortis

PHPCoder at www.phpide.de is a complete free php editor  IDE (for Windows). The 
latest version has sorted out some of the quirks of the previous versions.

Drivers for Windows (and links to Linux Driver sites) can be found at 
www.windrivers.com.

Regards, Paul Shortis


- Original Message -

Date:  Fri, 18 May 2001 17:17:15 +0530 
From:  Sharmad Naik [EMAIL PROTECTED] 
Reply-To:  Sharmad Naik [EMAIL PROTECTED] 
Subject:  php notepad 
To:  [EMAIL PROTECTED] 
   


Hi,
I have recently fineshed my project in php
I want to document it.
Can anyone tell me an editor that highlights the code of PHP ?
and another question off the way is can i get drivers anywhere for an 
Epson stylus Color 480 printer
-Regards
-- 
The secret of the universe is @*í!'ñ^#+ NO CARRIER
__ _ _ _ _
|_|_||_||_||\/||_|| \
_|| || || \| || ||_/



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




Re: [PHP-DB] user need password

2001-05-16 Thread Paul Burney

on 5/16/01 10:44 PM, andrie at [EMAIL PROTECTED] wrote:

 we know that every password in mysql was encryption using PASSWORD
 function. i have case that make me to send user password bymail.
 how can i get this user password ?

You can't.  It's a one way encryption.  You'll need to log into MySQL as
root and set the password to a new password that you can send to the user.

Paul


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




Re: [PHP-DB] Flash+PHP search error

2001-05-14 Thread Paul Burney

on 5/14/01 2:37 PM, Brian Tegtmeier ([EMAIL PROTECTED]) wrote:

 I am currently in the progress of setting up a page for my client located at
 http://64.77.185.160/main.html which integrates a PHP search function to
 find keywords on a page. The problem I am running into now is when I goto
 that main.html page, I get this \n, $header); } } ? message above my
 Flash movie and have no idea why it is causing it on the Unix server with
 PHP 4.05.

Looking at the source of nav.html in IE, I see that PHP isn't parsing the
page.  All of the PHP is visible.  IE is just trying to display what it can
of what it sees.   Try changing the file name to nav.php.

HTH,

Paul

++
Paul Burney
Webmaster and Open Source Developer
Educational Technology Unit
Graduate School of Education and Information Studies
University of California, Los Angeles
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++


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




Re: [PHP-DB] Creating/reading [TAGS]

2001-05-10 Thread Paul Burney

on 5/10/01 3:07 PM, David Balatero ([EMAIL PROTECTED]) wrote:

 I am making a content backend for my site, and I need pointers or ideas
 on how to implement a formatting system like the one seen in UBB or
 phpBB, that uses bracket tags to format content submissions. For
 example:
 
 [b]bold[/b]
 etc.

Since phpBB is open source, you could probably look through the source code
and find it.  I would guess some kind of preg_replace loop.

http://www.phpbb.com/

Paul

++
Paul Burney
Webmaster and Open Source Developer
Educational Technology Unit
Graduate School of Education and Information Studies
University of California, Los Angeles
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++


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




[PHP-DB] The Dreaded Oracle 8 TNS:ORA-12154 Connection Error

2001-05-07 Thread Paul

I am running PHP 4.0.4pl1 in CGI mode on Windows NT4 SP6, using Apache or IIS Web 
Server's.

I am concentrating on Apache for this problem as it is identical irrespective of the 
Web Server.

I'm using one of the simplest possible connection mechanisms ...

if ($conn=Ora_Logon(user@mydatabase,pass))
{
echo SUCCESS ! Connected to database\n;
Ora_Logoff($conn);
}
else
{
echo Failed :-( Could not connect to database\n;
}

This works fine if PHP is run as an apache module but fails with the message 

Warning: Oracle: Connection Failed: ORA-12154: TNS:could not resolve service name in 
c:\program files\apache group\apache\htdocs\ora.php on line 10

When Apache is re-configured to run PHP as CGI (other html on the same page suce as 
phpinfo() shows up just fine).

At first I thought the Apache user may have been affecting privileges but the Apache 
User option doesn't work under Windows  I even tried running Apache as a service 
using the Administrator
account - no change. Have tried environment paths to ORACLE_HOME, TNS_PATH etc. etc. 
etc. all to no avail. We use sqlnet.ora with an oracle name server.

I have to use CGI as PHP4 isn't to production level for use as a Filter with IIS  
corporate policy dictates that I must prove PHP against ASP on the existing IIS server 
before I can even attempt using
Apache.

I would greatly appreciate any construction :-) advise anyone can offer.

Regards, Paul Shortis


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




[PHP-DB] The Dreaded Oracle 8 TNS:ORA-12154 Connection Error

2001-05-04 Thread Paul

I am running PHP 4.0.4pl1 in CGI mode on Windows NT4 SP6, using Apache or IIS Web 
Server's.

I am concentrating on Apache for this problem as it is identical irrespective of the 
Web Server.

I'm using one of the simplest possible connection mechanisms ...

if ($conn=Ora_Logon(user@mydatabase,pass))
{
echo SUCCESS ! Connected to database\n;
Ora_Logoff($conn);
}
else
{
echo Failed :-( Could not connect to database\n;
}

This works fine if PHP is run as an apache module but fails with the message 

Warning: Oracle: Connection Failed: ORA-12154: TNS:could not resolve service name in 
c:\program files\apache group\apache\htdocs\ora.php on line 10

When Apache is re-configured to run PHP as CGI (other html on the same page suce as 
phpinfo() shows up just fine).

At first I thought the Apache user may have been affecting privileges but the Apache 
User option doesn't work under Windows  I even tried running Apache as a service 
using the Administrator
account - no change. Have tried environment paths to ORACLE_HOME, TNS_PATH etc. etc. 
etc. all to no avail. We use sqlnet.ora with an oracle name server.

I have to use CGI as PHP4 isn't to production level for use as a Filter with IIS  
corporate policy dictates that I must prove PHP against ASP on the existing IIS server 
before I can even attempt using
Apache.

I would greatly appreciate any construction :-) advise anyone can offer.

Regards, Paul Shortis


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




[PHP-DB] PHP4, APACHE, SCO INFORMIX

2001-04-30 Thread Paul Gardiner

Hi Everyone,

Firstly, apologies for cross posting but I wanted to make sure this got to
the relevant people.

I am continually getting people asking me off list for information regarding
building the above combination. I don't mind as it's encouraging to see PHP
spreading to this type of platform. All I ask is that if anyone requires
help then please direct it to the PHP-Install list so others may benefit
from the replies given. I will try to compile a complete install guide when
I get time and perhaps one of the PHP associated sites would be able to host
it. It maybe an idea for others to contribute with their particular build so
that a centrally managed install guide could be set up and perhaps free up
some of the traffic on the lists?

Best regards,
- Paul -


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




Re: [PHP-DB] update problems

2001-04-26 Thread Paul Burney

on 4/26/01 11:16 AM, ns ([EMAIL PROTECTED]) wrote:

 hi
 i got to have data from mysql database to drop down menues in html how do i
 do that?
 I can´t get any data to my drop down menues...

You need to run a query, something like:

SELECT DISTINCT from TABLE where SOMETHING

and they run a while loop to drop the values into a select field, i.e.,

echo 'option value=' , $row['fieldname'] , '' , $row['fieldname'] ,
'/option';

You may want to check out a small script I wrote:

http://webdevel.burney.ws/code/id?14

Hope that helps,

Paul Burney

++
Paul Burney
Webmaster and Open Source Developer
Educational Technology Unit
Graduate School of Education and Information Studies
University of California, Los Angeles
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++


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




[PHP-DB] PHP question needing info

2001-04-20 Thread Paul S

I have a question that I need help with.

The question is that how do I execute a script in PHP.

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

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




[PHP-DB] reword my question

2001-04-20 Thread Paul S

How do I execute a shell script in php?

I just started to use php and I am learning it on the
fly for a project.

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

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




Re: [PHP-DB] HTTP1.0/404 Not found

2001-04-18 Thread Paul Burney

on 4/18/01 10:41 AM, Sharmad Naik at [EMAIL PROTECTED] wrote:

 I want to know now to avoid displaying HTTP/1.0 404 Not found page.
 Despite the fact that i want say that everyone to go to index.php page on
 any non existing URL.
 pls tell me where to do the exact and how?.
 Pls help me

Sorry, you should really subscribe to the PHP General list to post
non-php/database questions.  You can do so here:

http://php.net/support.php

That page also has information about news groups and list archives.

Sincerely,

Paul Burney
http://paulburney.com/


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




Re: [PHP-DB] build drop-down pick from MYSQL table

2001-04-12 Thread Paul Burney

on 4/12/01 8:40 AM, Quentin Krengel ([EMAIL PROTECTED]) wrote:

 I have found examples of building a dropdown list, and have found examples of
 reading a mysql table, but am looking for examples of creating a drop-down
 list with the results of a mysql query.  Ie, I have an admin screen where
 partners are added, and want to store the partners in a mysql table
 (maintained by an admin page).  In my "add account page" I want to build a
 dropdown list using the output from the "partners" mysql table.

You might want to try a little script I wrote called s2s.  You can
view/download it here:

http://webdevel.burney.ws/code/id?14

It may work for you "out of the box" but if not, it shouldn't be hard to
modify for your use.

 Thanks in advance for the help, and if you reply, please tell me where your
 favorite php-mysql tutorial is.

I like devshed.com tutorials.  The format they use is very nice and easy to
follow.

Hope it helps,

Paul Burney

++
Paul Burney
Webmaster and Open Source Developer
Educational Technology Unit
Graduate School of Education and Information Studies
University of California, Los Angeles
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++


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




Re: [PHP-DB] substring_index Part 2

2001-04-12 Thread Paul Burney

on 4/12/01 9:53 AM, Mike Baerwolf ([EMAIL PROTECTED]) wrote:

 $result = mysql_query("SELECT substring_index(body, \".\" ,2) FROM
 news",$db) or die ("Invalid Query");
 if ($myrow = mysql_fetch_array($result)) {
 
 do {
 
 printf("%s\nbr", $myrow["headline"]);
 printf("%s\n", $myrow["body"]);
 
 
 } while ($myrow = mysql_fetch_array($result));

Maybe it's because the if statement doesn't have an ending }.  Of course, it
could have been snipped for brevity.  I assume that somewhere in the code
you have the connection made and the database selected.

Can you try this?

?php

if (mysql_num_rows($result)  0) {

while ($myrow = mysql_fetch_array($result))

printf("%s\nbr", $myrow['headline']);
printf("%s\n", $myrow['body']);

}

} else {

echo 'No results found!';

}

?

The above is untested but I think it will work.  :)

Hope that helps,

Paul Burney

++
Paul Burney
Webmaster and Open Source Developer
Educational Technology Unit
Graduate School of Education and Information Studies
University of California, Los Angeles
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++


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




Re: [PHP-DB] select substring_index

2001-04-11 Thread Paul Burney

on 4/11/01 7:48 PM, Mike Baerwolf at [EMAIL PROTECTED] wrote:

 SELECT substring_index( body, ".  ", 2) FROM news;
 
 This works great from the mysql client but when I try it using php with
 this:
 
 $result = mysql_query("SELECT substring_index(body, "." ,2) FROM news"

The way you have this written, PHP is using the . for concatenation.  To fix
the problem you need to alternate or escape the quotes, i.e. :

$result = mysql_query("SELECT substring_index(body, \".\" ,2) FROM news"

or

$result = mysql_query('SELECT substring_index(body, "." ,2) FROM news'

or

$result = mysql_query("SELECT substring_index(body, '.' ,2) FROM news"

Hope that helps,

Paul Burney
http://paulburney.com/


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




[PHP-DB] ocibindbyname: ORA-01008: not all variables bound

2001-04-05 Thread Paul Fernandez

Hello,

The goal here is to insert a single row, then get a numerical value "id"
(generated by the insert trigger) to use in another insert statement.

I get, "ORA-01008: not all variables bound" when running this script:

?
$query = "insert into table (col1, col2) values ($val1,$val2) returning id
into :id";
$parsed = OCIParse($connection,$query);

OCIBindByName($parsed,":id",$id,-1);

// execute first insert
$cursor = OCIExecute($parsed);

// construct and execute 2nd insert
$query2="insert into table2(id,etc) values (:id, $etc)";
$parsed2 = OCIParse($connection,$query2);
$cursor2 = OCIExecute($parsed2);
?

It seems so simple.  What am I doing wrong?

Paul Fernandez



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




Re: [PHP-DB] meta tag inside php / redirect / refresh

2001-03-16 Thread Paul Gardiner

Hi Marc,

Try this - untested and I'm very sleepy, but should get you closer ;o)

html
head
titleRefresh Test/title
?php if($check_num == 0) echo "META HTTP-EQUIV=\"REFRESH\"
CONTENT=\"5;URL=http://www.chescolawyers.com/BB/index2.shtml\"";
?
/head
    

Regards,
- Paul -



- Original Message - 
From: "Marc Bragg" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 16, 2001 4:09 AM
Subject: [PHP-DB] meta tag inside php / redirect / refresh


 Crazy after hours of syntax. How do you insert php code so that on
 different results, 1 or 0, a different the resulting html page is
 redirected or refreshed to a dfiferent url . . . . i tried:
 
 ?php if(check_num == 0) meta http-equiv="refresh"
 content="5;URL=http://www.chescolawyers.com/BB/index2.shtml"
 ?
 
  to no avail.
 
 help
 
 thanx
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


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




Re: [PHP-DB] Connecting to Oracle

2001-03-13 Thread Paul

Joe,

I have had some tough problems changing SIDs in oracle via PHP.  If your
tnsnames.ora file correctly defines the SID, you may not need to declare it
again via PHP.

if you run phpinfo(), see if these values are already defined, and then try
to connect with default values...

--

""Joe Brown"" [EMAIL PROTECTED] wrote in message
98loaj$m76$[EMAIL PROTECTED]">news:98loaj$m76$[EMAIL PROTECTED]...
 I'm not looking forward to this...  Due to circumstances beyond my
control,
 I will be forced into a similar configuration soon.

 Try putenv("ORACLE_SID=WKDS.world");
 If your sqlnet.ora does does not specify .world as the default domain,
then
 that may be the problem.

 Was your TNSNAMES.ORA file ftp'd from somewhere to where it is now?
   If so, did you use the ascii or text mode option?

 HTH

 "Herbert Groot Jebbink" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
 
  I have problems connecting with PHP to Oracle.
 
  - Operating system is Windows 95
  - Apache version is 1.3.14
  - The PHP version is 4.04pl1 (NuSphere 1.13.6)
  - The line "extension=php_oracle.dll" is active in php.ini
  - De Oracle Database version is 7.3.4.0.0
  - De SQL*NET client version is 2.3.4.0.0
  - Using the SQL PLUS 3.3.4.0.0 client on this machine works fine:
  - The ociw32.dll file is in the path of the webserver
 
  The test program is:
 
   ?php
putenv('ORACLE_HOME=c:\orawin95');
putenv("ORACLE_SID=WKDS");
$conn = ora_logon("hgj@wkds", "hgj");
   ?
 
  The result is:
 
   Warning: Unable to connect to ORACLE (ORA-12154: TNS:could not resolve
   service name) in /www/data/ontwikkel/test/php/test3.php on line 4
 
  I have lookup the ORA-12154 error and it talks about the tnsnames.ora
  file, this file is located in c:\orawin95\network\admin\ and I have set
  ORACLE_HOME to c:\orawin95, so it must find that file, the part
  of the database in tnsnames.ora is below.
 
  wkds.world =
(DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = rnwux1)
(Port = 1521)
  )
  (ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = rnwux1)
(Port = 1526)
  )
  )
  (CONNECT_DATA = (SID = WKDS)
  )
)
 
 
  Greetings, Herbert
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



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




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




[PHP-DB] Microsoft SQL Server and views

2001-02-15 Thread Paul Clements

Hi,

Sorry if this has been asked before but I've looked everywhere and not found
the answer to the question
Can you access views from mssql_query?

I seem to be getting Invalid Object Name reported back to me.

Any help would be appreciated

Thanks

Paul Clements



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




Re: [PHP-DB] php client -- informix-se

2001-02-12 Thread Paul Gardiner

Hello Luigi,

I'm afraid before you're able to use the informix database it will have to
be upgraded to at least version 7.x. We have SCO Openserver 5.0.4 running
the Informix SE 7.2 with PHP4 and Apache and all works well. We too have an
NT server but would not even entertain the idea of running the web server
from there. For us the unix box is so much more reliable.

Regards,
- Paul -

- Original Message -
From: "Luigi Casiraghi" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 09, 2001 10:10 PM
Subject: [PHP-DB] php client -- informix-se


 Dear all,

 I have a  question for you.

 Given the following configuration:

 - One NT machine with Apache 3.14 and php4 (from www.php4.de) installed
(the one that should act like client)
 - One Sco_SV system Release 3.2v5.0.5 with INFORMIX-SE Version 5.10.UD1
(the server)

 Are my SCO-UNIX Release and INFORMIX-SE Version  suitable for use
 with PHP4 ?

 I would like to create php4 scripts that connect from the NT machine
 to the Informix Server, execute query, etc to diplay formatted data
 throught Apache.

 PHP has been configured to use the php_ifx.dll but when I execute
 a simple script with only phpinfo() to see php configuration I receive
 the following message:

 "can't find the dinamyc library isqlt09a.dll in the specified path"

 and as a consegunce

 "cant load php_ifx.dll..."

 the fact is that there isn't the file isqlt09a.dll on the NT system.

 what file is it ?

 What are the pieces I need to complete the puzzle and where can I get
 them ?

 a great thanks in advance to everyone that can give me an help.

 bye,

 Luigi Casiraghi
 [EMAIL PROTECTED]
 Italy


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




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




Re: [PHP-DB] passing object elements in urls

2001-02-06 Thread Paul Cooper

On Tue, Feb 06, 2001 at 05:46:25PM +, Darryl Friesen wrote:
  Got a slight problem. I'm attempting to pass a number of variables from
  one form to another. The problem occurs when one of the object elements
  contains more than one word.
 
 [snip]
 
 
  Any idea how to pass object elements with spaces in a URL?
 
 Try encoding the spaces as %20 (the hex value for a space).  There's
 probably a PHP function to do this for you (and one to do the reverse) -- I
 haven't looked.

Yes there are: urlencode() and urldecode()

http://www.php.net/manual/en/function.urlencode.php 
http://www.php.net/manual/en/function.urldecode.php 

Paul

 
 You could try using a + instead of a space too.
 
 
 - Darryl
 
  --
   Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED]
   Education  Research Technology Services, http://gollum.usask.ca/
   Department of Computing Services,
   University of Saskatchewan
  --
   "Go not to the Elves for counsel, for they will say both no and yes"
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
-
Paul Cooper |  Tel: 0121 331 7858
Senior Programmer and Database Engineer |  Fax: 0121 687 7859
UCEcom  |  mailto:[EMAIL PROTECTED]
University of Central England   |  http://www.ucecom.com
Birmingham, B4 7DX  |
-

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




Re: [PHP-DB] ENUM type

2001-01-15 Thread Paul DuBois

At 9:49 PM +0700 1/15/01, Cahyo S. Aji wrote:
I don't know what is the benefit if we use ENUM type.
can everybody explain it?

Examples:

It looks like a character column, but it's represented as an integer,
so operations on it can be quite fast.  The numeric representation
also takes less space, in most cases.

By using it, you make the legal values for a column explicit in the
column definition.

You can look up the legal values for the column from within programs.
For example, you can parse SHOW COLUMNS LIKE 'col_name' output to get
the legal enumeration values, then use them to construct a set of
radio buttons or a popup menu in a web form. That way your form always
presents exactly the legal options for the column.

You can also use the column definition when validating submitted forms
to make sure the value submitted is legal.

-- 
Paul DuBois, [EMAIL PROTECTED]

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




<    1   2   3