[PHP-DB] Re: formating results in seperate tables?

2003-07-10 Thread DaSilentStorm
Hi,

you should try using a while loop instead of a for.

So write while ($threadResults = db_fetch($threadQuery)) { ...

The for loop might produce an additional row in your result.

Good luck,
Storm

Aaron Wolski [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 Hi All,

 Having some issues with the code below:

 ?php

 }

 ?
 tr valign=top

 ?php


 $col = explode(,,$threadsColumn);

 $col_search = (;
 for ($i=0;$icount($col);$i++) {

 $col_search .= $col[$i]. LIKE
 '%$threadsName%';
 if ($i != (count($col) -
 1)) {
 $col_search .=  OR ;
  }
 }

 $col_search .= );

 $threadQuery = db_query(SELECT * FROM kcs_threads WHERE
 $col_search GROUP BY id);

 if (db_numrows($threadQuery) 0) {

 for ($i=0;$threadResults =
 db_fetch($threadQuery);$i++) {


 ?
 td
 table
 width=340 border=0 cellspacing=0 cellpadding=0


 tr

 td class=adminThreadsDisplayText align=left?php echo
 trimString($threadResults[manufacturer],13); ?brimg
 src=../Graphics/spacer.gif width=85 height=2/td

 td class=adminthreadsDisplayText align=center?php echo
 $threadResults[colourID]; ?brimg src=../Graphics/spacer.gif
 width=85 height=2/td

 td class=adminthreadsDisplayText align=center?php echo
 $threadResults[type]; ?brimg src=../Graphics/spacer.gif
 width=85 height=2/td

 td class=adminthreadsDisplayText align=centera
 href=threadsedit.php?id=?php echo $threadResults[id]; if
 ($threadsColumn != ) echo threadsColumn=$threadsColumn; if
 ($threadsName != ) echo threadsName=$threadsName; ?font
 class=adminEditLinkEdit/font/anbsp;nbsp;a
 href=threadsdelete.php?id=?php echo $threadResults[id]; if
 ($threadsColumn != ) echo threadsColumn=$threadsColumn; if
 ($threadsName != ) echo threadsName=$threadsName; ?font
 class=adminEditLinkDelete/font/abrimg
 src=../Graphics/spacer.gif width=85 height=2/td

 /tr
 /table
 /td
 tdimg
 src=../Graphics/spacer.gif width=20 height=1/td
 ?php

 if ($i%2) {

 ?
 /tr
 tr valign=top

 ?php

 }
 }
 }

 else {

 ?
 td
 class=adminNoResultsText colspan=3 align=centerbrbrThere Are
 No Results Matching Your Search Criteria./td
 ?php

 }

 ?
 /tr


 This is producing an additional tdimg src=../Graphics/spacer.gif
 width=20 height=1/td within the tr/tr tags.

 Any clues what's up?

 Thanks!

 Aaron




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



[PHP-DB] phpMyAdmin-Problem

2003-07-10 Thread . ma
hi!

i have mysql 3.23.38 running on a IIS4 and php 4.3.2
i used phpmyadmin 2.3.2 with cookie authentication and everything 
worked well. until i wanted to upgrade phpmyadmin to 2.5.1 (last stable 
release).
i configured everything inside config.inc.php (added a controluser, 
etc) but now i cannot login anymore by cookie-authenticaion. i do not 
even get a wrong password or username-error
the phpmyadmin-faq contains this question:

 [1.3] I'm running phpMyAdmin with cookie authentication mode under 
PHP 4.2.0 or 4.2.1 loaded as an Apache 2+ module but can't enter the 
script: I'm always displayed the login screen.
This is a known PHP bug (see this bug report) from the official PHP bug 
database. It means there is and won't be any phpMyAdmin fix against it 
because there is no way to code a fix.

is this the same for php 4.3.2 and IIS4 ?

thx in advance .ma



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


[PHP-DB] ANN: Metastorage generates form handling classes

2003-07-10 Thread Manuel Lemos
Hello,

Metastorage generates form handling classes

In the continuation of the work to achieve further reduction of
application development efforts, the new release of Metastorage is now
capable of generating automatically classes that are able to handle
Web forms that serve as user interface to create new persistent
objects.
Complete announcement article:
http://www.meta-language.net/news-2003-07-10-metastorage.html
Screenshots:
http://www.meta-language.net/screenshots.html
Note: although it is not mentioned, the code generated by Metastorage 
should work with PEAR::MDB via Metabase wrapper.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] date, and time?

2003-07-10 Thread Tristan . Pretty
Cheers for the help on my last auto inc prob..
I checked out phpmyadmin, and I'm loving it...! cheers all

Anyway,
I want to know how to store a date like this in a MySQL database:

date(F j, Y, g:i a);

Resulting in:

July 10, 2003, 3:39 am

But what do I need to set my database table to, to capture the full data.
I can use text, but then I can't sort by date later on

Ideas?

Cheers list...

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



Re: [PHP-DB] date, and time?

2003-07-10 Thread jeffrey_n_Dyke

you could change mysql to a few different date formats, but i don't _think_
that is one of them.

Why not just take care of a format change on the way out with DATE_FORMAT.
Also, if you store the date as one of the defualt date[time] values then
you have tons of functions that you can run against your data...

http://www.mysql.com/doc/en/Date_and_time_types.html
http://www.mysql.com/doc/en/Date_and_time_functions.html

hth
jeff


   

  [EMAIL PROTECTED]
 
  sungard.com To:   [EMAIL PROTECTED]  
 
  cc:  

  07/10/2003 11:02 AM Subject:  [PHP-DB] date, and time?   

   

   





Cheers for the help on my last auto inc prob..
I checked out phpmyadmin, and I'm loving it...! cheers all

Anyway,
I want to know how to store a date like this in a MySQL database:

date(F j, Y, g:i a);

Resulting in:

July 10, 2003, 3:39 am

But what do I need to set my database table to, to capture the full data.
I can use text, but then I can't sort by date later on

Ideas?

Cheers list...

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







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



[PHP-DB] RE: Weird Segfaults with Oracle, PHP, Apache2

2003-07-10 Thread Harris, Jeff


I went through and generated a core file with php cgi and my test file.

Here's the gdb output.. It's failing on the Oracle library... Anyone know
where to look next?


[EMAIL PROTECTED] gsi]$ gdb /usr/local/bin/php core.843 
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for details.
This GDB was configured as i386-redhat-linux...
Core was generated by `php ora.php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libssl.so.2...done.
Loaded symbols for /lib/libssl.so.2
Reading symbols from /lib/libcrypto.so.2...done.
Loaded symbols for /lib/libcrypto.so.2
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /opt/oracle/OraHome1/lib/libclntsh.so.9.0...done.
Loaded symbols for /opt/oracle/OraHome1/lib/libclntsh.so.9.0
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /opt/oracle/OraHome1/lib/libwtc9.so...done.
Loaded symbols for /opt/oracle/OraHome1/lib/libwtc9.so
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
#0  0x407a5582 in sskgmstat () from
/opt/oracle/OraHome1/lib/libclntsh.so.9.0




-Original Message-
From: Harris, Jeff 
Sent: Tuesday, July 08, 2003 5:52 PM
To: '[EMAIL PROTECTED]'
Subject: Weird Segfaults with Oracle, PHP, Apache2



We're getting segfaults (11) when we try and execute a simple piece of
Oracle PHP code. This is a new installation and compilation of Apache2 and
we're just trying to see what is wrong. This particular code works on all of
our Apache 1.3 installations.

Versions: Redhat 8.0, PHP version 4.3.2, Apache version 2.0.46, Oracle
version 9i 9.2.0.1.0

We've worked through all of the oracle user issues with Apache, made sure
and set ORACLE_HOME and TNS_ADMIN.

the code we're executing is:

?php

echo 'here';
$conn = OCILogon(scott,tiger,db);
echo 'here2';

$stmt = OCIParse($conn, select original_system_reference, attribute8 from
apps.so_headers_interface_all where error_flag = 'Y');

echo 'here3';

OCIDefineByName($stmt, ORIGINAL_SYSTEM_REFERENCE, $order_number);
OCIDefineByName($stmt, ATTRIBUTE8, $attribute8);

OCIExecute($stmt);
echo 'here4';

while (OCIFetch($stmt)) {
echo 'here5';
  echo $order_number.;
  echo : .$attribute8.br;
}

echo 'here6';
  echo $order_number.;
OCIFreeStatement($stmt);
OCILogoff($conn);
echo 'here7';
?



The server segfaults right after it gets to here3. If you comment out
everything after here3, the page works fine. Running the $stmt select works
fine if you use sqlplus. I'm not sure why it's dying.


Has anyone seen anything like this?



---

Jeff Harris - Network Engineer
Golfsmith International, Inc.
CCNP, CCNA



[PHP-DB] PEAR DB getAssoc()

2003-07-10 Thread Jacob Marble
Hey all-
Could someone give an example of how to use the DB_Common::getAssoc()
function?  I'm trying to get an table into an array, and var_dump() shows
that the array is not associative.  Here's the code:

$sql = select * from sr_names;
$table = $db-getAssoc($sql);
echo var_dump($table);

And here's the output:

array(1) {
  [1]=
  array(16) {
[0]=
string(5) Jacob
[1]=
string(6) Marble
[2]=
NULL
etc...

As I understand it, an associative array should return something more
like:

array(1) {
  [1]=
  array(16) {
['firstname']=
string(5) Jacob
['lastname']=
string(6) Marble
['email']=
NULL
etc...

Or am I showing off my newness... ;-)  Any help greatly appreciated!!

Jake

LandEZ



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



[PHP-DB] PHP 4.2.3 MySQL mysql_query quoting syntax.

2003-07-10 Thread Vampyr Twilight
Greetings,

Prior to PHP 4.2.3, when inserting values from an array into mysql I could
do the following:
(assuming that $a is an array())

$qid = mysql_query( INSERT  INTO  table  (info)  VALUES ('$a[2]')  );

However this logic now fails with the following error:
Parse error: parse error, expecting `']'' in /path/to/script/my_query.php on
line 123

Thus making me have to rewrite the query as:

$qid = mysql_query( INSERT  INTO  table  (info)  VALUES ( ' .$a[2]. ' )
);

What happened?  Is this just a PHP.INI setting, or was PHP just being
leanent and now it's gotten strict and being a bully about this?  .. I would
really prefer not to have to re-write my entire projects queries because of
this change.  Any information on how to go back to the old behaviour or why
the old behaviour is now unacceptable are greatly apprecaited.

Thank you,
-V. Twilight ;.,


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



[PHP-DB] Re: phpMyAdmin-Problem

2003-07-10 Thread Stan Lemon
I know exactly what the problem is!!!  But...  I don't know where it is 
at :-(

I experienced this problem when I installed it on an IIS4 machine and 
found that somewhere in the authentication file it detetcts whether it 
is IIS or Apache and it has an if() {} and then an elseif() {} with no 
else.  The IIS function picks up if it is 5 or greater.  Thus IIS 4 
doesn't get caught.  It was really wierd.  I think I even sent a bug 
report in on ir, they must not have fixed it.  Anyhow, what you're going 
to need to do is to dig into the phpMyAdmin function and look for if 
statements with regular expressions searcing for IIS in a string.  When 
you do that eventually you'll find what you need.  Basically the problem 
is caused by poor programming in phpMyAdmin which does not account for 
ALL web servers.

Tip for future programmers.  If you have an if and an elseif you really 
need to finish with an else, otherwise you generally leave yourself open 
to bugs and problems.

Hope that helped somehow.

- Stan

. Ma wrote:
hi!

i have mysql 3.23.38 running on a IIS4 and php 4.3.2
i used phpmyadmin 2.3.2 with cookie authentication and everything worked 
well. until i wanted to upgrade phpmyadmin to 2.5.1 (last stable release).
i configured everything inside config.inc.php (added a controluser, etc) 
but now i cannot login anymore by cookie-authenticaion. i do not even 
get a wrong password or username-error
the phpmyadmin-faq contains this question:

 [1.3] I'm running phpMyAdmin with cookie authentication mode under 
PHP 4.2.0 or 4.2.1 loaded as an Apache 2+ module but can't enter the 
script: I'm always displayed the login screen.
This is a known PHP bug (see this bug report) from the official PHP bug 
database. It means there is and won't be any phpMyAdmin fix against it 
because there is no way to code a fix.

is this the same for php 4.3.2 and IIS4 ?

thx in advance .ma




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


Re: [PHP-DB] download php headers?

2003-07-10 Thread Jason Wong
On Friday 11 July 2003 05:41, Steve B. wrote:
 I'm trying to get a php page to go into a name/password header
 authenticated site and it doens't work (even though the same code works on
 a php auth site I post online) So I'm trying to find out how to print the
 headers receieved from a web page so I can go from there.
 How do I get http headers for somesite.com?
 I am doing the file method of getting the site currently.

With some un*x system you can use:

  lynx -mime_header

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
30. Ooops.  Save your work, everyone.  FAST!

--Top 100 things you don't want the sysadmin to say
*/


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