Re: [PHP-DB] Subject Matter

2013-08-26 Thread Thomas Rudy
There are a lot of off topic emails sent. But there is far more whining and
complaining. Good grief!


On Fri, Aug 23, 2013 at 2:40 PM, Tamara Temple tamouse.li...@gmail.comwrote:


 On Aug 23, 2013, at 7:32 AM, Jim Giner jim.gi...@albanyhandball.com
 wrote:

  On 8/23/2013 4:52 AM, Matt Pelmear wrote:
  On 08/23/2013 04:36 PM, Lester Caine wrote:
  Matt Pelmear wrote:
  I am not sure who runs the list, whether they care about off-topic
  posts,
  or whether anyone else cares about it.
 
  The php lists are only loosely moderated, but comments like yours
  usually bring things under control. I'd refer you to my recent post
  thought as to why the current threads are not that far off topic ;)
 
 
  Indeed, that thread is one that is on topic... but I think the
  signal-to-noise ratio on this list is rather poor ;)
  If I'm the only one bothered by it, it's no big deal for me to
  unsubscribe... I just thought I'd check the general opinion first.
  I don't run into these problems on the internals list... :-)
 
  -Matt
 
  Funny - I never knew this list was handling  off-topic posts that
 regularly.  I always thought this list was about using php to access
 database info and the problems incurred, such as Ethan's recent post about
 his bad query code.
 
  So - this is supposed to be about database integration?  I'll have to
 reconsider my subscription choice as well, just as soon as I look up
 whatever the heck that is.  :)

 This is the description on www.php.net/mailing-lists.php:

 Databases and PHP
 This list is for the discussion of PHP database topics

 Nothing more specific than that. I, personally, don't know of any PHP
 databases, so I'm going to assume it means the broader interpretation of
 using PHP with databases.


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




[PHP-DB] Re: [PHP] goto - My comments

2010-12-18 Thread Thomas Anderson
On Sat, Dec 18, 2010 at 11:44 PM, Robert Cummings rob...@interjinn.com wrote:
 On 10-12-19 12:17 AM, Ethan Rosenberg wrote:

 Dear List -

 Thanks to all for your EXCELLENT comments.  I definitly agree that
 goto is a command to be avoided at all costs.

 Closed-minded drivel (or you're buttering up the popular opinion crowd). A
 better approach is that goto should be used with caution.

 As for doing your homework for you... ummm no thanks. You should take the
 time to do the exercise so you gain the benefit of experience.

I would have thought school would have been out on account of Christmas and all.

In any event, here's my rewrite:

switch (true)
{
case isset($_POST['Site'])  trim($_POST['Site']) != '':
$sql1 = $sql1 . site = '$ste';
break;
case isset($_POST['MedRec']) trim($_POST['MedRe']) != '':
$sql1 = $sql1 . MedRec = '$req';
break;
// ...
default:
if(isset($_Request['Sex']) trim($_POST['Sex']) != '' )
{
if ($_REQUEST[Sex] == 0)
$sex = 'Male';
else
$sex = 'Female';

$sql1 = $sql1 .   = '$sex';
$sexdone = 1;
}

if(isset($_POST['Hx']) trim($_POST['Hx']) != '')
{
$sql1 = $sql1 . Hx  = '$hx';
$done = 1;
}
}

You could also do an if / else if / else if / ... / else.

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



Re: [PHP-DB] Problem with PDO Mysql and FETCH::ASSOC

2009-03-20 Thread Thomas Robitaille

Does anyone have any ideas as to what I might be doing wrong?

Thanks for any help!

Thomas



First of all check if you are actually connecting to the same  
database both times.


Start with printing $GLOBALS['database'] and see if it connects  
where you really want.


You mentioned a field def while printing the query's output which  
obviously is not included in the table's description. Have you  
changed the schema in the meantime?


Thanks for your suggestions.

I've managed to fix the issue by switching to a 32-bit installation of  
MySQL and Apache. The problem appeared to be due to the 64-bit  
versions somehow.


Thomas

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



[PHP-DB] Problem with PDO Mysql and FETCH::ASSOC

2009-03-19 Thread Thomas Robitaille

Hello,

I am using the following code to perform queries on a MySQL database:

$dbh = new PDO($GLOBALS['database'],$GLOBALS['username'], 
$GLOBALS['password']);

$dbh-setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$dbh-setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = $dbh-prepare(SELECT * FROM log);
$query-execute();
$results = $query-fetchALL(PDO::FETCH_ASSOC);
$dbh = null;

If I perform this query in MySQL, I get:

mysql select * from log;
+-++---+-- 
+++
| type| date   | client_id | model_id |  
request| message|
+-++---+-- 
+++
| message | 1.2375e+09 | domain.18052  |  |  
client_start   | started client |


However, if I perform this query with the PHP code above, I get:

Array ( [type] = error [date] = 1.2375e+09 [log] = [distributed] =  
client_start [def] = started client) )


which is clearly wrong. 'distributed' is actually the name of the  
database, so I don't really know what it is doing as a key in the  
above result.


If I use PDO::FETCH_BOTH instead of PDO::FETCH_ASSOC, I get

Array ( [type] = message [0] = message [date] = 1.2375e+09 [1] =  
1.2375e+09 [log] = [2] = domain.18052 [3] = [distributed] =  
client_start [4] = client_start [def] = started client [5] =  
started client )


which *does* contain the correct values with the numerical keys.  
Before using MySQL, I was using SQLite, and this problem did not occur.


The description of the table is:

mysql describe log;
+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| type  | char(10) | YES  | | NULL|   |
| date  | float| YES  | | NULL|   |
| client_id | char(50) | YES  | | NULL|   |
| model_id  | char(50) | YES  | | NULL|   |
| request   | char(20) | YES  | | NULL|   |
| message   | char(50) | YES  | | NULL|   |
+---+--+--+-+-+---+
6 rows in set (0.00 sec)

Does anyone have any ideas as to what I might be doing wrong?

Thanks for any help!

Thomas

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



[PHP-DB] Forms submitting to a session array

2008-01-13 Thread Thomas
I'm trying to create a shopping cart where users can visit a product page  
(called from a MySQL database depending on the url ending in  
?product_id=#). On the product page users can select options from dropdown  
lists (such as color, etc.) These dropdown lists are also dynamically  
generated from the database.


I need to store what the user has selected while the user browses the  
site. I want to also display what they've selected on a cart page.


I believe my best option is to store what they've selected in a session  
array. I'm not sure how to do this with the dropdown lists, etc.


Any help would be greatly appreciated!

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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



[PHP-DB] New to PHP/MySQL - Need help with images

2008-01-05 Thread Thomas
I'm attempting to make a table with one row and 3 columns holding three  
different images. I want each image URL to be called from my database.  
Everything is set-up in my database. When I use the following code, it  
places the same picture across the three columns and does this three times  
(creating three rows.) I want a different picture to be placed across the  
three columns and to have only one row. What can I do?


Here is the code:

$result = @mysql_query('SELECT image FROM specials');
$num=mysql_numrows($result);
$i = 0;
while ($i  $num) {
$image=mysql_result($result,$i,image);
?
table
tr
td
img src=? echo $image; ?
/td
td
img src=? echo $image; ?
/td
td
img src=? echo $image; ?
/td
/tr
?
$i++;
}
echo /table;
?

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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



[PHP-DB] Special chars UTF-8: sometimes ok, sometimes wrong

2007-10-18 Thread thomas Armstrong
 Hi.

Working with PHP 4.4 and mySQL 4.1, I've got some texts stored in a
UTF-8 table with special chars.

I serve a UTF-8 header within my HTML, Apache is configured to serve
UTF-8 and PHP scripts are saved in UTF-8 charset.

However, sometimes I get 'España' and other times 'Espa#65533;a'. The
difference? I press F5 (Refresh) bottom on my web browser (I use
Firefox and Internet Explorer).

This is the first time I experience this issue.

When I have suffered problems with special chars I use utf8_decode or
utf8_encode, but I always try to store text data in UTF-8 charset and
serve them always with UTF-8 PHP scripts.

However, this is a very odd issue, since it happens only with text
taken from DataBase, but not from texts written in scripts :(

Any similar experience?

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



[PHP-DB] Re: Query executing

2007-10-05 Thread Thomas Tschernich

How would I know if this mySQL query:

DELETE FROM `table` WHERE `date_to_be_deleted` LIKE '$todays_date'

actually deleted any rows from the table?


www.php.net/mysql_affected_rows

Greetings,
Thomas Tschernich

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



[PHP-DB] pdo::mysql and unbuffered queries

2007-10-05 Thread Thomas Tschernich

Hello there,

I tried using pdo (www.php.net/pdo) as it would be nice for my projects to 
be portable to another database systems, but quickly ran into problems.


The lesser important: One time, there was a simple typo in one of my queries 
and I got an error that php is not able to save session variables at the 
given path - I'm not joking! I worked several hours to solve that session 
problem just to realize the query had a bracket to few. I already got other 
errors in my queries where I was given a correct error trace, this is quite 
confusing.


The bigger important: I was not able to build nested queries. For example: 
Imagine you are running a bulletin board, and you have to select 10 posts in 
a thread. To each post, there is another information which is needed to be 
resolved from the database, so I have 1 more query for each of these posts. 
This is possible only with one of two workarounds .. I can use 
pdoStatement::fetchall() to instantly load all result rows into one array 
and afterwards looping through this array. After years of programming in 
classic php-mysql I am not used to this method at all and I do not think 
this is nice programming in concerns of memory usage as this array may 
become very big. The other option is to force queries to be buffered via the 
constantPDO::MYSQL_ATTR_USE_BUFFERED_QUERY, but then I would gave up 
independence as such code is not anymore compatible to other dbms than 
mysql.

In simple words: Can I have best of both worlds?

Big thanks in advance,
Thomas Tschernich 


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



[PHP-DB] RE : [PHP-DB] Re: RE : Re: [PHP-DB] pg_escape_bytea missing despite Postgre v.7.4.14

2007-03-07 Thread Thomas Woerly
Not at all. No version number for Postgres there.

--- Chris [EMAIL PROTECTED] a écrit :

 Thomas Woerly wrote:
  Hello,
  
  Thanks for you reply. Yeah, sorry for the subjet, wrong manipulation from
 me.
  
  With a phpinfo(), I have pgsql section. Is it ok ? My version of PHP is
 4.4.2,
  so this is ok too.
  
  pgsql
  
  PostgreSQL Support  enabled
  Active Persistent Links 0
  Active Links0
  
  Directive   Local Value Master Value
  pgsql.allow_persistent On   On
  pgsql.auto_reset_persistent Off Off
  pgsql.ignore_noticeOff  Off
  pgsql.log_noticeOff Off
  pgsql.max_links   Unlimited Unlimited
  pgsql.max_persistentUnlimited   Unlimited
 
 That looks fine. Does it give you a postgres version number there too?
 
 -- 
 Postgresql  php tutorials
 http://www.designmagick.com/
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 






___ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com

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



[PHP-DB] RE : ezmlm response

2007-03-06 Thread Thomas Woerly
Hello People

My first message on this list.

I am installing a collaborative platform using Apache2.0.59 / PHP4 and
Postgre 7.4.14

I have the following error

Call to undefined function: pg_escape_bytea()
in/home/demo/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php on line 407

When searching the Web, some say it is due a bad version of PostgreSQL, since
pg_escape_bytea() arrived at v.7.2.

My Webmin and pg_config --version say I have a 7.4.14 version.

I recompiled PHP with this
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-dbase
--with-filepro --enable-exif --with-xml --enable-ftp --with-db
--enable-bcmath
--enable-calendar --with-jpeg-dir --with-png-dir --with-gd
--enable-gd-native-ttf --with-freetype-dir --with-gettext --with-mysql
--with-zlib-dir --enable-trans-sid --with-imap --with-kerberos
--with-imap-ssl
--with-openssl --enable-sysvsem --enable-sysvshm --with-gettext --with-dom
--with-mcrypt --with-iconv --enable-mbstring=all --enable-mbregex --with-gd
--with-png-dir=/usr --with-jpeg-dir=/usr
--with-mime-magic=/usr/share/magic.mime
--with-pgsql=/usr/locla/pgsql/bin/pg_config

And I still get the message above. Any idea how to tackle this ?

Thanks for reading my request.

Thomas






___ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com

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



[PHP-DB] RE : Re: [PHP-DB] pg_escape_bytea missing despite Postgre v.7.4.14

2007-03-06 Thread Thomas Woerly
Hello,

Thanks for you reply. Yeah, sorry for the subjet, wrong manipulation from me.

With a phpinfo(), I have pgsql section. Is it ok ? My version of PHP is 4.4.2,
so this is ok too.

pgsql

PostgreSQL Support  enabled
Active Persistent Links 0
Active Links0

Directive   Local Value Master Value
pgsql.allow_persistent On   On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_noticeOff  Off
pgsql.log_noticeOff Off
pgsql.max_links   Unlimited Unlimited
pgsql.max_persistentUnlimited   Unlimited



--- Chris [EMAIL PROTECTED] a écrit :

 
  Call to undefined function: pg_escape_bytea()
  in/home/demo/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php on line
 407
  
  When searching the Web, some say it is due a bad version of PostgreSQL,
 since
  pg_escape_bytea() arrived at v.7.2.
  
  My Webmin and pg_config --version say I have a 7.4.14 version.
 
 Firstly please use a more appropriate subject ;) It lets people quickly 
 know if they can help or not.
 
 Does a phpinfo() page show postgres support working (ie is there a big 
 section called postgresql) ?
 
 Specifically what version of php are you using? This function came in at 
 4.2.0+
 
 http://php.net/pg_escape_bytea
 
 -- 
 Postgresql  php tutorials
 http://www.designmagick.com/
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 






___ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com

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



[PHP-DB] Inserting a php file into a mysql database

2005-12-25 Thread Thomas Bonham

Hello,

I am trying to insert a php page into a database. I need to know if 
there is something that I need to do when setting up the table, also is 
there something to do with the code.


Thank You for your help

Thomas

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



Re: [PHP-DB] User authentication and redirect

2005-07-15 Thread Thomas Dodson
 aren't supposed to be here;
  exit;
}

i hope i understood your problem correctly, and i hope i was of some 
help...this is the way i wrote my project, but it was only 
access-controlled on certain pages (i.e. inserting and deleting records)


--
Thomas Dodson
Programmer, Bioinformatics
S-327 Ag. Science North
Department of Entomology
University of Kentucky
Lexington, KY 40546-0091
Phone (859) 257-3169
Fax (859) 323-1120
Cell: (859) 420-1696

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



Re: [PHP-DB] User authentication and redirect

2005-07-14 Thread Thomas Dodson

Ahmed Saad wrote:


hi Vinny,

On 7/13/05, Vinny Lape [EMAIL PROTECTED] wrote:
 


If user validates then look at db entry location then redirect to
mydomain.com/location/index.php
   



i don't think it's a good idea. what if the user bookmarked or took
down a notice with the URL to your secured page
(mydomain.com/location/index.php)? then he would just type the url
heading directly for the bypassing your login page! i think u might
want to put the user authorization code in your index php or even
better put it in a file and require() that file at the top of of any
page u want to protect. you can either use sessions or plain HTTP
authentication  (which is not a very good idea).

-ahmed

 


perhaps if i had read the original message more carefully...
here are some functions for session based authentication that i use for 
one of my projects...they probably aren't as secure as they could be, im 
relatively new to scripting languages.


?php
   #this file should be in the include directory (include_path from 
php.ini), or the same directory as the functions which include it.

   #be sure to check file permissions if it doesnt work correctly!
   #This script assumes a database named DATABASE, and that user data 
is stored in a table called users, with (at least) fields user, 
password, and email. The password column must be char(32) type to accept 
the encrypted pwd

   #Thomas Dodson   [EMAIL PROTECTED]   24 May 2005

   function db_connect()
   {
   #connect to MySQL
   $link = mysql_connect('HOST', 'USER','PWD') or die('Could not 
connect: ' . mysql_error());

   #select database
   mysql_select_db('DATABASE') or die('Could not select database');

   return $link;
   }

   function encrypt($string) #hash then encrypt a string. the password 
column in the db must be CHAR(32) type

   {
   $crypted = crypt(md5($string), md5($string));
   return $crypted;
   }

   function login($user, $password) #this logs in the user by checking 
the name and pwd against the database. it returns true and writes the
   { #proper session variables if the 
user/pwd combo matches, otherwise it returns false. do NOT use this script
#to check the session variables for 
authorization, i wrote login_check() to do that.

   $auth = false;

   $link = db_connect();
   $result = mysql_query(SELECT password FROM users WHERE user = 
'$user', $link);

   $row = mysql_fetch_array($result, MYSQL_ASSOC);
   $pass = $row['password'];
   mysql_free_result($result);
   mysql_close($link);

   if ($pass === (Encrypt($password)))
   {
   session_start();
   $_SESSION['userid'] = $user;
   $_SESSION['pwd'] = $pass;
   $auth = true;
   }
   return $auth;
   }

   function login_check($user, $password) #this checks to make sure a 
user is logged in. if the user/pwd combo in the session var matches
   {   #the table entry, it returns 
true, otherwise it returns false. it does NOT write any session variables,
  #so use this script and NOT 
login() to check authorization

   $auth = false;
  
   if(!$user || !$password)

   {
   return $auth;
   }

   $link = db_connect();
   $result = mysql_query(SELECT password FROM users WHERE user = 
'$user', $link);

   $row = mysql_fetch_array($result, MYSQL_ASSOC);
   $pass = $row[password];
   mysql_free_result($result);
   mysql_close($link);

   if ($pass === $password)
   {
   $auth = true;
   }
   return $auth;
   }

   function write_log($string) #adds a datestamp and writes to logfile 
in /var/log. the owner of the file SL.log must be the same as the
   {#the user running the apache process 
(usually www-data)

   $string = ' ' . $string . \n;
   $filehandle = fopen('/var/log/SL.log', 'a');
   fwrite($filehandle, date('d M H:i:s')); #write date in format: 
01 Jun 23:01:01

   fwrite($filehandle, $string); #write log entry
   fclose($filehandle);
   }

   function calcElapsedTime($time) #returns elapsed time in seconds
   {

   $diff = time()-$time;
   $daysDiff = 0;
   $hrsDiff = 0;
   $minsDiff = 0;
   $secsDiff = 0;
  
   $sec_in_a_day = 60*60*24;


   while($diff = $sec_in_a_day)
   {
   $daysDiff++; $diff -= $sec_in_a_day;
   }
   $sec_in_an_hour = 60*60;
  
   while($diff = $sec_in_an_hour)

   {
   $hrsDiff++;
   $diff -= $sec_in_an_hour;
   }

   $sec_in_a_min = 60;

   while($diff = $sec_in_a_min)
   {
   $minsDiff++;
   $diff -= $sec_in_a_min;
   }

   $secsDiff = $diff;

   return ($minsDiff.' minute'.(($minsDiff  1) ? s : ).', 
'.$secsDiff.' second'.(($secsDiff  1) ? s : ));


   /*
   #this code

Re: [PHP-DB] Postgre SQL query error with PHP

2005-07-04 Thread Thomas Bonham
Thanks for the help.
It is working like it should.

Next on the query parameters.

Again Thanks for the help.
Thomas

On 7/2/05, Martín Marqués martin@bugs.unl.edu.ar wrote:
 El Sáb 02 Jul 2005 14:21, John DeSoi escribió:
 
  On Jul 2, 2005, at 9:17 AM, Thomas Bonham wrote:
 
   If you wouldn't mind look over this error to I would be very nice.
   The error that I'm have now is the following. It is probely very
   sample, but I'm still learning php so not for me it not.
 
  There is an example here, that I think will help you.
 
  http://www.php.net/manual/en/function.pg-fetch-row.php
 
  And if that does not help try just printing out the entire array so
  you know what is there.
 
  See the var_dump function:
 
  http://us2.php.net/manual/en/function.var-dump.php
 
 
 I personally think he should start here:
 
 http://pear.php.net/manual/en/package.database.db.php
 
 
 --
 select 'mmarques' || '@' || 'unl.edu.ar' AS email;
 -
 Martín Marqués  |   Programador, DBA
 Centro de Telemática| Administrador
Universidad Nacional
 del Litoral
 -
 


-- 
--
Thomas Bonham
[EMAIL PROTECTED]
bonhamlinux.org
Cell 602-402-9786

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



Re: [PHP-DB] Postgre SQL query error with PHP

2005-07-02 Thread Thomas Bonham
Thank.
The grant work.

If you wouldn't mind look over this error to I would be very nice.
The error that I'm have now is the following. It is probely very
sample, but I'm still learning php so not for me it not.

Error:
Connection to Data Base established
Notice: Uninitialized string offset: 1 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 27

Notice: Uninitialized string offset: 2 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 28

Notice: Uninitialized string offset: 3 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 29

Notice: Uninitialized string offset: 4 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 30

Notice: Uninitialized string offset: 5 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 31

Notice: Uninitialized string offset: 6 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 32

Notice: Uninitialized string offset: 7 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 33

Notice: Uninitialized string offset: 8 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 34

Notice: Uninitialized string offset: 9 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 35
data: 1, , , , , , , , , , 

It prints the first one then it errors.

Thank agin
Thomas

On 7/2/05, John DeSoi [EMAIL PROTECTED] wrote:
 
 On Jul 1, 2005, at 9:37 PM, Thomas Bonham wrote:
 
  Error:
  Connection to Data Base established
  Warning: pg_query(): Query failed: ERROR: permission denied for
  relation property in
  /var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
  line 20
 
  Warning: Wrong parameter count for pg_num_rows() in
  /var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
  line 21
 
  As it show above I can connect to the database but no query.
  The part of the code that is error I Think is the following.
  $query = pg_query (
  SELECT * FROM property
  );
 
 
 The first error is telling you that you don't have permission to
 select from the property table. See the GRANT command and make sure
 you have the correct permissions to work with the table.
 
 The warning needs to be fixed also. The pg_num_rows command only
 takes one parameter. You need to remove the $dbconn parameter.
 
 
 John DeSoi, Ph.D.
 http://pgedit.com/
 Power Tools for PostgreSQL
 
 


-- 
--
Thomas Bonham
[EMAIL PROTECTED]
bonhamlinux.org
Cell 602-402-9786

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



[PHP-DB] Postgre SQL query error with PHP

2005-07-01 Thread Thomas Bonham
Hello All,
I'm having a problem setting up the query with postgreSQL. I can do
what I won't for the command line but it error when I try it with the
PHP functions.
My errors and code are below.
CODE:
 
?php
/* Setting up connection to data base. */
$conn = dbname='cornerstone_property' user='stone' host='localhost';
/* Connecting to the data base */
$dbconn = pg_connect(dbname='cornerstone_property' user='stone'
host='localhost');
/* Connecting to see if the connection is true */
if($dbconn == true)
{
echo Connection to Data Base established;
}
else
{
echo Connection to Data Base failed;
}
/* End of Connectting to the data base */

$query = pg_query (
SELECT * FROM property
);
$rows = pg_num_rows($dbconn,$query);

for ($i = 0; $i  $rows; $i++)
{
$data = pg_fetch_result($query, $i);
echo data: $data[0],
$data[1],
$data[2],
$data[3],
$data[4],
$data[5],
$data[6],
$data[7],
$data[8],
$data[9],
br\n;
}
pg_close($dbconn);
?
Error:
Connection to Data Base established
Warning: pg_query(): Query failed: ERROR: permission denied for
relation property in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 20

Warning: Wrong parameter count for pg_num_rows() in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 21

As it show above I can connect to the database but no query.
The part of the code that is error I Think is the following.
$query = pg_query (
SELECT * FROM property
);
Thanks for the help.
Thomas

-- 
--
Thomas Bonham
[EMAIL PROTECTED]
bonhamlinux.org
Cell 602-402-9786

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



[PHP-DB] PostgreSQL error with php

2005-06-26 Thread Thomas Bonham

Hello All,
I’m trying to get php to connect to my PostgreSQL database.
The code that I’m using is below.


   htmlheadtitleLogin/title

   /head
   body
   ?php
$conn = dbname=auth user=auth;
$db = pg_connect ( $conn );
   ?
   /body
   /html

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su – postgres

-bash-3.00$ createuser –D –A –E
auth
-bash-3.00$ createdb auth

Thanks Helping

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



[PHP-DB] PostgreSQL error with PHP

2005-06-26 Thread Thomas Bonham

Hello All,
I’m trying to get php to connect to my PostgreSQL database.
The code that I’m using is below.


   htmlheadtitleLogin/title

   /head
   body
   ?php
$conn = dbname=auth user=auth;
$db = pg_connect ( $conn );
   ?
   /body
   /html

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su – postgres

-bash-3.00$ createuser –D –A –E
auth
-bash-3.00$ createdb auth

Thanks Helping

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



[PHP-DB] PostgreSQL error with PHP

2005-06-26 Thread Thomas Bonham

Hello All,
I’m trying to get php to connect to my PostgreSQL database.
The code that I’m using is below.


   htmlheadtitleLogin/title

   /head
   body
   ?php
   $conn = dbname=auth user=auth;
$db = pg_connect ( $conn );
   ?
   /body
   /html

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su – postgres

-bash-3.00$ createuser –D –A –E
auth
-bash-3.00$ createdb auth

Thanks Helping

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



[PHP-DB] PostgreSQL with php error

2005-06-26 Thread Thomas Bonham

Hello All,
I’m trying to get php to connect to my PostgreSQL database.
The code that I’m using is below.


   htmlheadtitleLogin/title

   /head
   body
   ?php
$conn = dbname=auth user=auth;
$db = pg_connect ( $conn );
   ?
   /body
   /html

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su – postgres

-bash-3.00$ createuser –D –A –E
auth
-bash-3.00$ createdb auth

Thanks Helping

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



[PHP-DB] Re: PostgreSQL error with PHP

2005-06-26 Thread Thomas Bonham
I modafide the code some more and now with the following code I get this 
error.

CODE:
 htmlheadtitleLogin/title

   /head
   body
   ?php

pg_connect(name=auth); (user=auth);
   ?
   /body
   /html


Parse error: parse error, unexpected '=' in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Thanks

Thomas Bonham wrote:

Hello All,
I’m trying to get php to connect to my PostgreSQL database.
The code that I’m using is below.


   htmlheadtitleLogin/title

   /head
   body
   ?php
   $conn = dbname=auth user=auth;
$db = pg_connect ( $conn );
   ?
   /body
   /html

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su – postgres

-bash-3.00$ createuser –D –A –E
auth
-bash-3.00$ createdb auth

Thanks Helping


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



Re: [PHP-DB] Re: PostgreSQL error with PHP

2005-06-26 Thread Thomas Bonham

Thanks for the help.
The code now looks like this.
CODE:

   htmlheadtitleLogin/title

   /head
   body
   ?php

$conn = pg_connect(user=auth dbname=auth password=redhat)
or die (Could not connect) ;
echo Connectd Successfully;
pg_close($conn);

   ?
   /body
   /html

And now the error I get is the following.


Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8

Could not connect


Thomas

Robbert van Andel wrote:

The error is in your function pg_connect
pg_connect(name=auth user=auth);

I'm not a PostgreSQL user but your connection string should be enclosed into
by quotes.  Documentation can be found at
http://us3.php.net/manual/en/function.pg-connect.php

Hope this helps,
Robbert

-Original Message-
From: Thomas Bonham [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 26, 2005 5:43 PM

To: php-db@lists.php.net
Subject: [PHP-DB] Re: PostgreSQL error with PHP

I modafide the code some more and now with the following code I get this 
error.

CODE:
  htmlheadtitleLogin/title

/head
body
?php

pg_connect(name=auth); (user=auth);
?
/body
/html


Parse error: parse error, unexpected '=' in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Thanks

Thomas Bonham wrote:


Hello All,
I'm trying to get php to connect to my PostgreSQL database.
The code that I'm using is below.


  htmlheadtitleLogin/title

  /head
  body
  ?php
  $conn = dbname=auth user=auth;
   $db = pg_connect ( $conn );
  ?
  /body
  /html

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su - postgres

-bash-3.00$ createuser -D -A -E
   auth
-bash-3.00$ createdb auth

Thanks Helping





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



Re: [PHP-DB] Re: PostgreSQL error with PHP

2005-06-26 Thread Thomas Bonham
I add the hostname and port, then I configure postgresql.conf and enable 
the port 5432 line in the config file.


So this is the new code.


   htmlheadtitleLogin/title

   /head
   body
   ?php

$conn = pg_connect(
user=auth dbname=auth password=redhat host=thomas.example.com
port=5432 ) or die (Could not connect) ;
echo Connected Successfully;
pg_close($conn);

   ?
   /body
   /html

With the new error.

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not 
connect to server: Connection refused Is the server running on host 
thomas.example.com and accepting TCP/IP connections on port 5432? in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 10

Could not connect

Thomas



Robbert van Andel wrote:

You might need to include the hostname and port.

-Original Message-
From: Thomas Bonham [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 26, 2005 6:48 PM

To: php-db@lists.php.net
Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP

Thanks for the help.
The code now looks like this.
CODE:

htmlheadtitleLogin/title

/head
body
?php

$conn = pg_connect(user=auth dbname=auth password=redhat)
or die (Could not connect) ;
echo Connectd Successfully;
pg_close($conn);

?
/body
/html

And now the error I get is the following.


Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8

Could not connect


Thomas

Robbert van Andel wrote:


The error is in your function pg_connect
pg_connect(name=auth user=auth);

I'm not a PostgreSQL user but your connection string should be enclosed


into


by quotes.  Documentation can be found at
http://us3.php.net/manual/en/function.pg-connect.php

Hope this helps,
Robbert

-Original Message-
From: Thomas Bonham [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 26, 2005 5:43 PM

To: php-db@lists.php.net
Subject: [PHP-DB] Re: PostgreSQL error with PHP

I modafide the code some more and now with the following code I get this 
error.

CODE:
 htmlheadtitleLogin/title

   /head
   body
   ?php

pg_connect(name=auth); (user=auth);
   ?
   /body
   /html


Parse error: parse error, unexpected '=' in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Thanks

Thomas Bonham wrote:



Hello All,
I'm trying to get php to connect to my PostgreSQL database.
The code that I'm using is below.


 htmlheadtitleLogin/title

 /head
 body
 ?php
 $conn = dbname=auth user=auth;
  $db = pg_connect ( $conn );
 ?
 /body
 /html

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su - postgres

-bash-3.00$ createuser -D -A -E
  auth
-bash-3.00$ createdb auth

Thanks Helping







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



Re: [PHP-DB] Re: PostgreSQL error with PHP

2005-06-26 Thread Thomas Bonham

I rewrote the code. This is the code and errors.
This is starting to get old, I have been working on this for over a week 
now.


CODE:

   htmlheadtitleLogin/title

   /head
   body
   ?php

$conn = user=auth password=redhat
dbname=auth host=localhost port=5432;

$dbconn = pg_connect($conn);
echo Connected Successfully;


   ?
   /body
   /html

Error:

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not 
connect to server: Connection refused Is the server running on host 
localhost and accepting TCP/IP connections on port 5432? in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 11

Connected Successfully


Thomas



Thomas Bonham wrote:
I add the hostname and port, then I configure postgresql.conf and enable 
the port 5432 line in the config file.


So this is the new code.


   htmlheadtitleLogin/title

   /head
   body
   ?php

$conn = pg_connect(

user=auth dbname=auth password=redhat host=thomas.example.com
port=5432 ) or die (Could not connect) ;
echo Connected Successfully;
pg_close($conn);

   ?

   /body
   /html

With the new error.

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not 
connect to server: Connection refused Is the server running on host 
thomas.example.com and accepting TCP/IP connections on port 5432? in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 10

Could not connect

Thomas



Robbert van Andel wrote:


You might need to include the hostname and port.

-Original Message-
From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, 
June 26, 2005 6:48 PM

To: php-db@lists.php.net
Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP

Thanks for the help.
The code now looks like this.
CODE:

htmlheadtitleLogin/title

/head
body
?php

$conn = pg_connect(user=auth dbname=auth password=redhat)

or die (Could not connect) ;
echo Connectd Successfully;
pg_close($conn);

?

/body
/html

And now the error I get is the following.


Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8

Could not connect


Thomas

Robbert van Andel wrote:


The error is in your function pg_connect
pg_connect(name=auth user=auth);

I'm not a PostgreSQL user but your connection string should be enclosed



into


by quotes.  Documentation can be found at
http://us3.php.net/manual/en/function.pg-connect.php

Hope this helps,
Robbert

-Original Message-
From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, 
June 26, 2005 5:43 PM

To: php-db@lists.php.net
Subject: [PHP-DB] Re: PostgreSQL error with PHP

I modafide the code some more and now with the following code I get 
this error.

CODE:
 htmlheadtitleLogin/title

   /head
   body
   ?php
  
pg_connect(name=auth); (user=auth);

   ?
   /body
   /html


Parse error: parse error, unexpected '=' in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Thanks

Thomas Bonham wrote:



Hello All,
I'm trying to get php to connect to my PostgreSQL database.
The code that I'm using is below.


 htmlheadtitleLogin/title

 /head
 body
 ?php
 $conn = dbname=auth user=auth;
  $db = pg_connect ( $conn );
 ?
 /body
 /html

Warning: pg_connect(): Unable to connect to PostgreSQL server: 
FATAL: IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su - postgres

-bash-3.00$ createuser -D -A -E
  auth
-bash-3.00$ createdb auth

Thanks Helping








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



Re: [PHP-DB] Re: PostgreSQL error with PHP

2005-06-26 Thread Thomas Bonham

I think so.
I'm going to go there my book (agin) and I'm also going to ask the head 
IT guy.


Thanks for all of your help!

Thomas


Robbert van Andel wrote:

Can you log into the PostgreSQL server from the console or command line?
Are you sure you are using the right username, password or host?

-Original Message-
From: Thomas Bonham [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 26, 2005 8:03 PM

To: php-db@lists.php.net
Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP

I rewrote the code. This is the code and errors.
This is starting to get old, I have been working on this for over a week 
now.


CODE:

htmlheadtitleLogin/title

/head
body
?php

$conn = user=auth password=redhat
dbname=auth host=localhost port=5432;

$dbconn = pg_connect($conn);
echo Connected Successfully;


?
/body
/html

Error:

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not 
connect to server: Connection refused Is the server running on host 
localhost and accepting TCP/IP connections on port 5432? in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 11

Connected Successfully


Thomas



Thomas Bonham wrote:

I add the hostname and port, then I configure postgresql.conf and enable 
the port 5432 line in the config file.


So this is the new code.


  htmlheadtitleLogin/title

  /head
  body
  ?php
   
   $conn = pg_connect(

   user=auth dbname=auth password=redhat host=thomas.example.com
   port=5432 ) or die (Could not connect) ;
   echo Connected Successfully;
   pg_close($conn);
   
  ?

  /body
  /html

With the new error.

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not 
connect to server: Connection refused Is the server running on host 
thomas.example.com and accepting TCP/IP connections on port 5432? in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 10

Could not connect

Thomas



Robbert van Andel wrote:



You might need to include the hostname and port.

-Original Message-
From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, 
June 26, 2005 6:48 PM

To: php-db@lists.php.net
Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP

Thanks for the help.
The code now looks like this.
CODE:

   htmlheadtitleLogin/title

   /head
   body
   ?php
   
   $conn = pg_connect(user=auth dbname=auth password=redhat)

   or die (Could not connect) ;
   echo Connectd Successfully;
   pg_close($conn);
   
   ?

   /body
   /html

And now the error I get is the following.


Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8

Could not connect


Thomas

Robbert van Andel wrote:



The error is in your function pg_connect
pg_connect(name=auth user=auth);

I'm not a PostgreSQL user but your connection string should be enclosed



into



by quotes.  Documentation can be found at
http://us3.php.net/manual/en/function.pg-connect.php

Hope this helps,
Robbert

-Original Message-
From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, 
June 26, 2005 5:43 PM

To: php-db@lists.php.net
Subject: [PHP-DB] Re: PostgreSQL error with PHP

I modafide the code some more and now with the following code I get 
this error.

CODE:
htmlheadtitleLogin/title

  /head
  body
  ?php
 
   pg_connect(name=auth); (user=auth);

  ?
  /body
  /html


Parse error: parse error, unexpected '=' in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Thanks

Thomas Bonham wrote:




Hello All,
I'm trying to get php to connect to my PostgreSQL database.
The code that I'm using is below.


htmlheadtitleLogin/title

/head
body
?php
$conn = dbname=auth user=auth;
 $db = pg_connect ( $conn );
?
/body
/html

Warning: pg_connect(): Unable to connect to PostgreSQL server: 
FATAL: IDENT authentication failed for user auth in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su - postgres

-bash-3.00$ createuser -D -A -E
 auth
-bash-3.00$ createdb auth

Thanks Helping








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



[PHP-DB] [DB_DataObject] why is there no query($query, $params) method?

2005-05-09 Thread Thomas
Hi
DB_DataObject uses PEAR::DB internally, which provides a nice query 
method with two arguments: the SQL statement (with placeholders) and a 
parameter array, so that I don't have to do any escaping etc.

Is there any reason that this method signature is not supported by 
DB_DataObject? There is a query method, of course, but it takes only one 
SQL string argument..

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


Re: [PHP-DB] [DB_DataObject] why is there no query($query, $params) method?

2005-05-09 Thread Thomas
Sorry, but doesn't make sense to me, since there is nothing parsing the 
result then.

If you have a look at the _query() method, it does the essential parsing 
of the sql result, raising errors etc.

I don't want to bypass the DataObject framework at this point.
T
Kieran.Tully AT acm.org wrote:
On 09/05/05, Thomas [EMAIL PROTECTED] wrote:

Is there any reason that this method signature is not supported by
DB_DataObject?

Perhaps because it doesn't make sense to wrap every DB
method when you can already do
$dataObject-getDatabaseConnection()-query(...)
--
Kieran Tully, Software Developer and Tenor
Reply to Kieran.Tully AT acm.org
http://kieran.tul.ly  http://www.cs.tcd.ie/~tullyka

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


RE: [PHP-DB] i want to unsubscribe

2004-01-18 Thread Thomas J. Rudd

See
To unsubscribe, visit:  http://www.php.net/unsub.php



-Original Message-
From: Mrs.Jomon [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 18, 2004 10:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] i want to unsubscribe

hi, i am not concentrating php now nd i have to
unsubscribe from this group. how can i do that . help
me
thanks


__
Do you Yahoo!?
Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

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

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



RE: [PHP-DB] chmod on win xp

2004-01-17 Thread Thomas J. Rudd
How exactly are you wanting to
chmod the file attributes?
(with a script or in general?)

-Original Message-
From: mayo [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 17, 2004 2:17 PM
To: php
Subject: [PHP-DB] chmod on win xp

so I would like to write to file on my local box. 
I've looked but I don't see how to chmod.

using:  windows xp and iis 5

-- gil

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

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



[PHP-DB] SQL Server Connect Issues

2003-11-03 Thread Thomas W. Gallup
First, I will admit that I am new to PHP.  I'm installing PHP on our Windows
2K / IIS server for some users who want to use it.  We also host SQL Server
7 for websites.  I'm getting the following error on the server, and on the
client's webpages:

PHP Warning: Unknown(): Invalid library (maybe not a PHP library) 'msql.dll'
in Unknown on line 0

Here is what I have done so far:

- I originally installed PHP 4.3.3 on the server using the Windows Installer
version.
- Uncommented out the extension=php_mssql.dll line inside of the php.ini
file.
- Figured out that I needed to download the extensions since they weren't
included in the Installer version.
- Added all of the php_*.dll files to the same directory as the PHP.EXE
file.  (I've also tried putting these in the WINNT\System32 directory, with
the same luck.)
- Made sure the msql.dll file is in the same directory as the PHP.EXE file.
(Again...tried in the WINNT\System32 directory.)
- Made sure the ntwdblib.dll file was in the same directory as the PHP.EXE
file.  (As above...tried the WINNT\System32 directory.)

Originally, I was having problems with an error about the msql.dll file not
being found.  Once I had it put into place, then the current error message
came about, and I have not been able to get it to go away.

I've tried about everything I could find on the Internet about this type of
error.  The strange thing is that it appears to be talking to SQL Server
just fine, since the PHPBB program I also installed for one user connected
to the database at least long enough to create all of the tables and fields
required in the install.php file.

I keep seeing information about having to recompile the PHP.EXE with certain
settings using FreeTDS, but from what I have gathered, that is only required
if running on Linux.  (Right??)

Any help anyone can give me would be great.

Thanks,

~ Tom

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



Re: [PHP-DB] AGONIZING Mysql Select DB issue.

2003-08-18 Thread Thomas Deliduka
As I mentioned your suggestion here does work, however while the example was
simple, the application is very extensive and changing every SQL call is not
possible.

On 8/17/03 4:56 PM this was written:

 
 Try using the SQL to select which database.
 
 example, instead of:
 
 select * from table1
 
 use:
 
 select * from database1.table1
 
 if that works, and the php command doesn't that may mean the the mysql client
 lib is broken, although, I've been using it with mysql 4 and it seems to work
 fine. 
 
 -Micah
 
 
 On Sunday 17 August 2003 1:49 pm, Thomas Deliduka wrote:
 I'm not making two connections, I'm making one and only one call to
 mysql_connect.  Also, there is no way in that function as per the
 definition page of it (http://us3.php.net/mysql_connect) to have the
 database selected as per your example below.
 
 With my connection though, when I do:
 $dbh = Mysql_connect(blah, blah, blah)
 Mysql_select_db(db1)
 
 I do call:
 Mysql_query(query, $dbh);
 
 For some reason even though I am calling mysql_select_db(db1) it is
 latching onto the first available database it has access to (or not as the
 case/permissions may be) and chooses db2 instead.
 
 I don't know why, connecting to the MySQL 3.23 it selects the right
 database, connecting to the Mysql 4.x server it doesn't allow a selecting
 of the table even though I do the select function and it returns true as it
 was selected properly.
 
 On 8/16/03 12:23 AM this was written:
 If you are doing this:
 
 $dbh = mysql_connect(db1, blah blah blah);
 $dbh2 = mysql_connect(db2, blah blah blah);
 
 Then
 
 $r = mysql_query(select * from mytable);
 
 will use the db2 connection, because it is the most recent.  However, if
 you do this:
 
 $r = mysql_query(select * from mytable, $dbh);
 
 it will use the first connection, as specified in the handle that is
 passed back by mysql_connect.  mysql_query uses the most recent
 connection by default; you can override this action by specifying which
 DB handle to use for a given query.  Replace $dbh with $dbh2 to select
 from tables on the second database.
 
 Peter
 
 On Fri, 15 Aug 2003, Thomas Deliduka wrote:
 Here's the stats:
 
 Two servers:
 
 Server 1, Mysql 4.0.12, PHP 4.3.2, apache 1.3.27
 Server 2, Mysql 4.0.14, PHP 4.3.2, apache 1.3.27
 
 --
 
 Thomas Deliduka
 IT Manager
  -
 Xenocast
 Street Smart Media Solutions
 http://www.xenocast.com/
 

-- 

Thomas Deliduka
IT Manager
 -
Xenocast
Street Smart Media Solutions
http://www.xenocast.com/



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



Re: [PHP-DB] AGONIZING Mysql Select DB issue.

2003-08-18 Thread Thomas Deliduka
I am not using $dbh and $dbh2 I'm only making ONE connection to the
database.  I AM using mysql_query($sql,$dbh) when I make the call.  I am
using mysql_select_db($dbname,$dbh) to do the connection to the database but
it's not selecting the one that I want.  It's choosing another one and I
don't know why!

My statement that the 3.23 server chooses the right one is with another
website setup almost the same way. In fact, the code is the same for both
but the main database server for each is different.  The only difference
between the two is that the one connecting to the 4.x server doesn't
selected the database when the one connecting to the 3.23 server (another
separate website) does select the right one.

On 8/16/03 12:26 AM this was written:

 Oh yeah -- just swap the $dbh and $dbh2 variables on the other server, and
 your code will work both places (the only difference being $dbh is the
 server the code is on, and $dbh2 is the other server).
 
 I would use the handle in your mysql_query calls, rather than the
 mysql_select_db(); gets too weird.  Just open two connections, one to each
 (if you must) and go from there.
 
 From the docs:
 
 mysql_select_db() sets the current active database on the server that's
 associated with the specified link identifier. If no link identifier is
 specified, the last opened link is assumed. If no link is open, the
 function will try to establish a link as if mysql_connect() was called
 without arguments, and use it.
 
 Every subsequent call to mysql_query() will be made on the active
 database.
 
 Peter
 
 On Fri, 15 Aug 2003, Thomas Deliduka wrote:
 
 The ONLY way I  have been able to work around this issue is before I call
 the SQL query I have to add db1.mytable to every call to the table. I.e.
 Adding db1 to the beginnign. Then it works around the call to the wrong
 database.  This cannot happen all the time. The application is very
 extensive and the code is shared between sites so I can't just do this.
 
 Does anyone have any clue why even though I'm calling mysql_select_db(db1)
 it still tries to gather data from db2?  This only happens when I'm
 connecting from Server 2 to server 1 it does not happen any other time.
 Incidentally it doesn't happen when I'm connecting from server 2 to another
 server running mySQL 3.23.54 there is no problem at all.
 
 I'm thinking it's a permissions system or something funky with MySQL 4 but I
 don't know for sure.  Any ideas?
 
 --
 
 Thomas Deliduka
 IT Manager
  -
 Xenocast
 Street Smart Media Solutions
 http://www.xenocast.com/
 
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 ---
 Peter Beckman  Internet Guy
 [EMAIL PROTECTED] http://www.purplecow.com/
 ---
 

-- 

Thomas Deliduka
IT Manager
 -
Xenocast
Street Smart Media Solutions
http://www.xenocast.com/



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



Re: [PHP-DB] AGONIZING Mysql Select DB issue.

2003-08-18 Thread Thomas Deliduka
Didn't work.

On 8/18/03 11:51 AM this was written:

 Same login for remote and local but I wonder if I did create a remote-only
 user it will work better.
 
 On 8/18/03 11:33 AM this was written:
 
 Agreed, sounds like a pain. to keep two copies. But if you do it to both
 copies, and use the same code both places (connect via URL, not 'localhost'
 even if you are on the same machine) then it wouldn't be any extra trouble.
 
 The OS will realize that the URL is localhost and make that connection via a
 socket anyways.
 
 Something else to check; if you're using two logins, one for remote, one for
 local, verify that their database permissions are the same.

-- 

Thomas Deliduka
IT Manager
 -
Xenocast
Street Smart Media Solutions
http://www.xenocast.com/



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



Re: [PHP-DB] AGONIZING Mysql Select DB issue.

2003-08-17 Thread Thomas Deliduka
I'm not making two connections, I'm making one and only one call to
mysql_connect.  Also, there is no way in that function as per the definition
page of it (http://us3.php.net/mysql_connect) to have the database selected
as per your example below.

With my connection though, when I do:
$dbh = Mysql_connect(blah, blah, blah)
Mysql_select_db(db1)

I do call:
Mysql_query(query, $dbh);

For some reason even though I am calling mysql_select_db(db1) it is
latching onto the first available database it has access to (or not as the
case/permissions may be) and chooses db2 instead.

I don't know why, connecting to the MySQL 3.23 it selects the right
database, connecting to the Mysql 4.x server it doesn't allow a selecting of
the table even though I do the select function and it returns true as it was
selected properly.

On 8/16/03 12:23 AM this was written:

 If you are doing this:
 
 $dbh = mysql_connect(db1, blah blah blah);
 $dbh2 = mysql_connect(db2, blah blah blah);
 
 Then
 
 $r = mysql_query(select * from mytable);
 
 will use the db2 connection, because it is the most recent.  However, if
 you do this:
 
 $r = mysql_query(select * from mytable, $dbh);
 
 it will use the first connection, as specified in the handle that is passed
 back by mysql_connect.  mysql_query uses the most recent connection by
 default; you can override this action by specifying which DB handle to use
 for a given query.  Replace $dbh with $dbh2 to select from tables on the
 second database.
 
 Peter
 
 On Fri, 15 Aug 2003, Thomas Deliduka wrote:
 
 Here's the stats:
 
 Two servers:
 
 Server 1, Mysql 4.0.12, PHP 4.3.2, apache 1.3.27
 Server 2, Mysql 4.0.14, PHP 4.3.2, apache 1.3.27

-- 

Thomas Deliduka
IT Manager
 -
Xenocast
Street Smart Media Solutions
http://www.xenocast.com/



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



[PHP-DB] AGONIZING Mysql Select DB issue.

2003-08-15 Thread Thomas Deliduka
Here's the stats:

Two servers:

Server 1, Mysql 4.0.12, PHP 4.3.2, apache 1.3.27
Server 2, Mysql 4.0.14, PHP 4.3.2, apache 1.3.27

My HTTP is setup on Server 2 (and server 1 as well) I'm setting up a mirror
on Server 2 and it connects to the DB on server 1.

Privs are setup that user has DB access to server 1 from 2 and all that.

I've been working on this for over 2 hours so I am sorry for being very
clear.

My connection string in PHP connects to server 1's DB and then I have a
mysql_select_db() command to select the database. My debugging code shows
that I'm selecting the right DB (let's call it db1) and it returns true as
if it selected fine.

However, whenever I do a query I get an error like Table 'db2.mytable'
doesn't exist  (Notice db2 not db1)  (there are like 30 databases on here
I'm just using these two as an example). It's latching onto the wrong
database!

Now I get this error if I enable Select_Priv in the User table, if I turn
that off and rely only on the privs in the 'db' table I get select command
denied to user: '[EMAIL PROTECTED]' for table 'mytable'  because it's
attempting to do a select on db2 not 1.  I don't know why.

The ONLY way I  have been able to work around this issue is before I call
the SQL query I have to add db1.mytable to every call to the table. I.e.
Adding db1 to the beginnign. Then it works around the call to the wrong
database.  This cannot happen all the time. The application is very
extensive and the code is shared between sites so I can't just do this.

Does anyone have any clue why even though I'm calling mysql_select_db(db1)
it still tries to gather data from db2?  This only happens when I'm
connecting from Server 2 to server 1 it does not happen any other time.
Incidentally it doesn't happen when I'm connecting from server 2 to another
server running mySQL 3.23.54 there is no problem at all.

I'm thinking it's a permissions system or something funky with MySQL 4 but I
don't know for sure.  Any ideas?

-- 

Thomas Deliduka
IT Manager
 -
Xenocast
Street Smart Media Solutions
http://www.xenocast.com/



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



[PHP-DB] korean characters out of ms sql

2003-06-08 Thread Thomas Zibolowski
I try to build a small webserver using php in cgi mode connecting to a mssql
database. It works allready with 11 different languages. But now I try to
read hangul (korean chars). Under IIS (same php config, same script, same
database) I got the right characters out of the database. Trying to use my
own webserver failded - means I get wrong characters out of the query.
Anyone a idea how it works??
Thanx in advance.



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



[PHP-DB] Re: SQL Server connection error.

2003-06-08 Thread Thomas Zibolowski
Try using mssql

Russell Roberts-Spears [EMAIL PROTECTED] schrieb im
Newsbeitrag news:[EMAIL PROTECTED]
 Hi,

 I am new to PHP DB code and am currently struggling with the connection to
 SQL Server 2000. I am using ODBC and have created a System DSN with
 integrated NT security specifiying which DB etc. I have written the
 following code and posted it in the htdocs folder for Apache. (We are all
 running on Win2000 platforms, Web server is set apart from the DB server,
 but linked via LAN.

 PHP code:


 HEAD
   TITLEADODB Test in PHP/TITLE
 /HEAD
 BODY
   ?php

 // simple conection


 $cnx = odbc_connect('web', '', '');
 file://query
 $SQL_Exec_String =  select * from TblClients;
 file://ejecucion query
 $cur= odbc_exec( $cnx, $SQL_Exec_String );
 echo  table border=1trthDni/ththNombre/th.
 thcodigo/ththciudad/th/tr\n;
while( odbc_fetch_row( $cur ) ) {
   $Title= odbc_result( $cur, 1 );
   $Fname= odbc_result( $cur, 2 );
   $Surname= odbc_result( $cur, 3 );
   $Address1= odbc_result( $cur, 4 );
echo trtd$Title/tdtd$Fname/td.
 td$Surname/tdtd$Address1/td/tr\n;
}
echo  /table;

 ?
 /BODY
 /HTML

 


 I then get back the following error:



 Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login
 failed for user 'PROTE\LATTITUDWEBSERV$'., SQL state 28000 in SQLConnect
in
 C:\Apache\Apache2\htdocs\DBtest.php on line 9

 Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource
in
 C:\Apache\Apache2\htdocs\DBtest.php on line 10
 DATA FROM SQL SERVER WITH PHP4 Cand_ID Password

 Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result
 resource in C:\Apache\Apache2\htdocs\DBtest.php on line 14



 Am at a loss as to why the error. Have created another DSN in same system
 which links in using VB to the same SQL Server using the same NT
integrated
 security and it is fine, so I am a little perplexed.

 Any help or pointers would be gratefully received


 Best regards



 Russell

 _
 Stay in touch with absent friends - get MSN Messenger
 http://www.msn.co.uk/messenger




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



[PHP-DB] RE: copying data

2002-12-15 Thread Thomas G. Knight
There is a utility called MyAcess it is like MyODBC and I have used it to do
this exact thing. It works very well. I believe you can find it on
Freshmeat.

Thomas G. Knight
[EMAIL PROTECTED]
http://www.slaponline.com

-Original Message-
From: David Eisenhart [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 15, 2002 4:51 AM
To: [EMAIL PROTECTED]
Subject: Re: copying data


If its a 'one off' kind of transfer then i'd recommend that you consider
doing what I did - export the data from Access to text file(s) and then
import from the text file(s) into MySQL (phpMyAdmin is v handy for this lind
of task) {Of course if you want a more automated solution then this is not
the way to go)

David Eisenhart


 If I have a microsoft access file .mdb on my server, can I use  a php page
 to move the data from the file to a mysql db?

 Thanks,
 Eddie





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




Re: [PHP-DB] ROugh idea of speed

2002-11-09 Thread Thomas Lamy
Steve Vernon [mailto:steve;extremewattage.co.uk] wrote:

 Hiya,
 Just wondering what is the rough idea of speed of a 
 server like this is
 holding a database with millions of records. I know its 
 difficult, depends
 on the data stored etc.
 
 Its basically storing an index int and about 5 or so char 
 field (50
 long). In total I want to store 500 million records. Accessed 
 using PHP.
   a.. 2x Intel Pentium III 1260 CPU or higher
   b.. 1 GB RAM
   c.. 60 GB hard drive
   d.. 20 GB traffic/month
   e.. RedHat LInux 7.2
 Ive read that its better to store the data in different 
 databases on the
 same server?
 
 Can someone please give me a rough idea of the speed and how many
 servers needed, my client wants to know how much it will cost 
 to host the
 site.
 
  Anyone have any experience with holding a lot in MySQL? 
 Any idea of
 speed would be great.
 
One of my clients is running a special interest portal, with roughly 200-300
parallel users in peak times, and about 1000 SQL queries/sec (of which about
90% are SELECTs). For stability and scalability reasons, we have an LVS
(http://linuxvirtualserver.org/) cluster for http, and 2 mysql servers
(Athlon 1800+, 512 MB, SCSI-RAID) with active/active replication, having a
loadaverage of about 0.10 at peak times.
Our database is about 1 Gig now, storing authentication- and user data
(including user-uploadable pictures, which make 600 MB by now).

We had many problems with mysql running on the same machines apache was
running (freezes and deadlocks with 1 httpd consuming 400+ MB and
loadaverage 100+), for yet unknown reasons (kernel = 2.4.16 comes to
mind...), which were all solved moving to the above configuration.

I am really confident with the current setup, which is running for half a
year now.  But keep in mind that - most of the times - you get far more
performance by optimizing your database (and queries) than by upgrading
hardware (the --log-slow-queries and --log-long-format options to mysqld are
your friend).

Thomas

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




Re: [PHP-DB] Idea as to why this query won't work as expected?

2002-11-05 Thread Thomas Lamy
Dave Smith [mailto:DavidSmith;byu.net] wrote:
 
 I can never remember whether SQL is left-to-right, right-to-left, or 
 some other deviant. Using parens is a sure way to guarantee that your 
 statements are processed in the order you desire.
 
 --Dave
 
It's easy if you remember: AND is equal to multiplication, OR is equal to
addition. Multiplications are done before additions, so ANDs are done before
ORs.

Thomas

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




Re: [PHP-DB] catalog system

2002-10-21 Thread Thomas Lamy
Sorry, didn't want to be that offensive. It just comes through from time to
time.

Thomas

Sparks [mailto:alex;paychoice.com] wrote:
 
 Yes, I've been trying to learn what I need.  Yes, I've surfed the
 newbie/wanna be places.  I just asked if anyone knew of one, 
 not asking to
 build it for me.  Thought I'd try and learn from one and make my own.
 
 If someone will point me to the Nubee-forum, I will gladly go.
 
 Wannabe
 
 
 Thomas Lamy [EMAIL PROTECTED] wrote in message
 news:656F04F343FC25409463829A15B5FDDC08AFC4;netwake-nt.netwake.de...
  Doesn't seem so. Wannabes/Leechers never die. They haven't really
 understood
  what this media ought to be.
 
  Most of the time it's faster (and wiser) to switch brain on 
 for at least
 ten
  minutes, rather than surfing beginner's guides for hours. 
 Otherwise get
  yourself some training day(s).
  Really.
 
 
  [No, this was not off-topic]
 
  Thomas
 
  PS: I (and many others on the list) _like_ to help people 
 with problems
 when
  their stuck. But from time to time this list tends to be a 
 nubee-forum.  I
  take time from my projects to read this list (and answer 
 sometimes), just
 to
  give back to the community what I got - fast help when _I_ 
 got stuck.
 
 
 
  Aaron Wolski [mailto:aaronjw;martekbiz.com] wrote:
  
   Build you own.
  
   Does no one want to 'work' for their projects these days?
  
   *shrug*
  
   Aaron
  
   -Original Message-
   From: Sparks [mailto:alex;paychoice.com]
   Sent: Monday, October 21, 2002 9:29 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP-DB] catalog system
  
  
   Greetings,
  
   I'm looking for a cataloging system.  I've found some but
   they all deal
   with e-commerce, which I don't want.  I'm trying to 
 catalog items by
   country, then by catagories, then by items.  I've been to all the
   regular download sites but no luck :(
  
   any help would be grateful
  
   sparks
  
  
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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




Re: [PHP-DB] easier way to do this? (time interval)

2002-10-11 Thread Thomas Lamy

Hi,

convert your date to UNIX_TIMESTAMP, which is number of seconds since
1.1.1970, and you can use simple math, as in

  $query=mysql_query(
SELECT dtg 
FROM techs 
WHERE 
  tech='$user'
AND
  UNIX_TIMESTAMP(dtg)  UNIX_TIMESTAMP(NOW()) - 86400 
AND
  HOUR(dtg)=7
  );
... where 86400 = 24 hours (in seconds)

See http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1302


Thomas


 -Ursprüngliche Nachricht-
 Von: Thoenen, Peter Mr. EPS
 [mailto:[EMAIL PROTECTED]]
 Gesendet: Freitag, 11. Oktober 2002 06:34
 An: [EMAIL PROTECTED]
 Betreff: [PHP-DB] easier way to do this? (time interval)
 
 
 Hello,
 
 Curious if there is an easier way to do this (using just SQL 
 and not PHP).
 SQL seems powerful enough to do this but can't think of the 
 synatx.  Note, I
 am using MySQL so no sub-selects (or other useful items).  
 Basically trying
 to pull all records for a 24 hour period but instead of -2400,
 0700-0700 (next day).
 
 if (date(H)7){
 
   $query=mysql_query(
 SELECT dtg 
 FROM techs 
 WHERE 
   tech='$user'
 AND
   DAYOFMONTH(NOW())=DAYOFMONTH(dtg)
 AND
   HOUR(dtg)=7
   );
 
 } else {
 
   $query=mysql_query(
 SELECT dtg 
 FROM techs 
 WHERE 
   tech='$user' 
 AND 
 (
   (DAYOFMONTH(NOW())=DAYOFMONTH(dtg) AND HOUR(dtg)7)
   OR
   ((DAYOFMONTH(NOW())-1)=DAYOFMONTH(dtg) AND HOUR(dtg)=7)
 )
   );
 
 }
 
 Cheers,
 
 -peter
 

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




Re: [PHP-DB] Error query : mysql_result

2002-10-10 Thread Thomas Lamy



Burgess [mailto:[EMAIL PROTECTED]] wrote:
 Hi
 
 I have used the mysql_result function to return some specific 
 information
 from database.  The information is returned as it should but 
 I keep getting
 this error message:
 
 Warning: Unable to jump to row 0 on MySQL result index 4 in
 /u1.bath/s31/eh842/public_html/SCR/register/process.php on line 140
 
 My script, in part, reads as below:
 
133   // check to see if company exists in db
134  
135 $CompanyQuery = mysql_query(SELECT coid FROM co_details 
136  WHERE co_name =
137  '$company' AND co_city = '$city' AND co_country = '$co_country');
138  
139  $CompanyExist = mysql_num_rows($CompanyQuery);
140  $company_id= mysql_result($CompanyQuery,0,0);
141  
142  if ($CompanyExist  0) {
143  
144//if company exists add workplace details
145 $confirmkey =  md5(uniqid(rand()));
146$signup_id = signup_details($username, $title, $fname, 
 []
 
I have inserted the line numers where I think they are right, please correct
me...

This seems to be a common trivial error: in 139, you get the number of rows
found, but if there are none, you try to retrieve data in line 140, where
you get the error message. Exchange line 140 with 142, and the error message
will go away.

And please, the next time you ask here, post only code snippets (e.g.
beginning of function to 2-5 lines from where you get the error), and
include line numbers. Thanks.

Thomas

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




AW: [PHP-DB] OT...where do I go for this......?

2002-10-10 Thread Thomas Lamy

Have you checked apache's config file for:

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source  .phps

?

IIRC Apache denies POST to file types not registered for... Also it may be
possible that your OS upgrade has overwritten your (old, maybe handcrafted)
httpd.conf.


Thomas


Michael Cortes [mailto:[EMAIL PROTECTED]] wrote:
 Gesendet: Donnerstag, 10. Oktober 2002 18:52
 An: [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] OT...where do I go for this..?
 
 
 I just checked and register_globals are on in php.ini.  I 
 have also previously been in the 
 httpd.conf in my previous attempts to fix this problem.   I 
 have googled my fingers off and all 
 fixes have mentioned the conf file for apache.  I have played 
 with options ExecCGI as well as 
 other options as per google search results.
 
 BTW... I am trying to use the POST method in my php scripts.
 
 
 
 On 10 Oct 2002 at 10:20, Naved, Masroor wrote:
 
  Michael,
  
  The easist way of fixing this is to turn register_globals on. It is
  defaulted to off since a few versions ago, I believe. 
 However, there are
  some security concerns you should be aware of with this 
 option. Google
  around for some discuss about this.
 
 On 10 Oct 2002 at 12:09, John W. Holmes wrote:
 
  That would be an Apache configuration issue. Somewhere in 
 http.conf, I
  think, you can choose whether or not to allow GET/POST operations.
  
  -Original Message-
  
  I am working on a simple inventory program and am running 
 into the following
  messageMethod 
  Not Allowed
  The requested method POST is not allowed for the
  URL/cafe_inventory/choose.php. Apache/1.3.23 Server at 
 (domain.net) Port 80
  
  If anyone can think of a mailing list, chat room, or even 
 paid tech support
  to help me with this 
  problem, I would greatly appreciate it.
 
 
 Michael Cortes
 Fort LeBoeuf School District
 34 East 9th Street
 PO Box 810
 Waterford PA 16411-0810
 814.796.4795
 Fax1 814.796.3358
 Fax2 978-389-1258
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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




Re: [PHP-DB] update and join?

2002-10-10 Thread Thomas Lamy

Cory Hicks [mailto:[EMAIL PROTECTED]] wrote:
 Hello to all!
 
 Quick questionis it possible to do an update query w/ a 
 join yet? If not, what is your preferred method? Would you 
 take care of it on the PHP side?
No, it's not possible, at least not with MySQL 3.x. MySQL 4.1, currently in
development, will feature nested subqueries and multi-table-updates.
 
 I need to update a table w/ data from another table if 
 certain conditions are true, i.e the fields in the table to 
 be joined are NULL
 
I have to do that a couple of times, and always do it this way:
Build a SELECT statement, selecting all the data you will need in the
updates, and the primary key for the table which needs updates.
Fetch all the data in a nested array, like this:
  $a = array(primary key 1 = array (col1=data1,col3=data3),
 primary key 2 = array (col2=data2,col3=data3),
 );
and then, do the updates in a neat foreach loop:
  foreach ($a as $pkey=$data) {
[ build update stmt from $data array ]
dbquery ($stmt)
  }

Hope this helps.

Thomas

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




AW: [PHP-DB] error_reporting()

2002-09-30 Thread Thomas Lamy

Do you have
display_errors = On
in your php.ini ?

Ryan Jameson (USA) wrote:
 
 I do the following 
 
 ?PHP
 error_reporting(E_ALL);
 echo error_reporting();
 ?
 
 and it says 2047 and still reports no errors. What overrides 
 my setting?
 
 Thanks...
  Ryan

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




[PHP-DB] Need help urgent!!

2002-09-26 Thread Thomas \omega\ Henning

I'm using PHP4.2.2 Win with MySQL 3.2.52 Win and PHP doesn't pass vars from
1 php to the other how i fix it?

Thanks



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




AW: [PHP-DB] getting mysql_fetch_row into array

2002-09-23 Thread Thomas Lamy

Hi,

it would have been easier to help you if you included some code snippet...

Use something like this:

$res = mysql_query (SELECT COUNT(deptid) FROM maintenance GROUP BY
deptid);
$deptcount = array();   // reset the array
while ($row = mysql_fetch_row ($res)) {
  $deptcount[] = $row[0];
}


Thomas

 -Ursprüngliche Nachricht-
 Von: LSC Exhibits Department [mailto:[EMAIL PROTECTED]]
 Gesendet: Montag, 23. September 2002 19:17
 An: '[EMAIL PROTECTED]'
 Betreff: [PHP-DB] getting mysql_fetch_row into array
 
 
 Going through brain-lock here. From this query Select 
 count(deptid) from
 maintenance group by deptid ,I get 11 rows. What I need to 
 do is get an
 array like $a=array(315,11,43,67,415,32,25,63,93,46,76) from 
 this query, so
 that 
 $a[0]=315
 $a[1]=11
 $a[2]=43 
 and so on. The best I can get is ;
 $a[0][0]=315
 $a[0][1]=11
 $a[0][2]=43 and so on. Does anyone have any ideas???
 
 John Coder
   
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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




AW: [PHP-DB] Large files using phpMyAdmin

2002-09-22 Thread Thomas Lamy

Hi,

1. Problem (Uploads)
Have a look at your php.ini, max_upload_size is 2 MB per default, you may
wish to increase this. Not sure if phpMyAdmin has another parameter to
configure this...

2. Problem (pics messed up)
Seems to be some magic quotes problem. In your php.ini, check
magic_qoutes_gpc and magic_quotes. Can't tell how you designed picture
uploads, but if you did it the right way (my opinion, no flames :-), both
need to be Off.


Thomas


 Von: Steve Vernon [mailto:[EMAIL PROTECTED]]
 Gesendet: Sonntag, 22. September 2002 20:00
 An: [EMAIL PROTECTED]
 Betreff: [PHP-DB] Large files using phpMyAdmin
 
 
 Hiya,
 So on the net I ask for a dump of my database using 
 myPHPadmin, get a
 2mb sql file. Put it in my local copy of myphpadmin and it 
 wont accept it.
 If I remove some of the lines then it works so I suppose its 
 something to do
 with the size. Can this be fixed? Is it to do with timeouts?
 
 The other problem is that I store pictures in the 
 database, about 1.8mb
 worth. They look fine on the net but when i download they are 
 messed up!!!
 They used to till I formatted my hard disk, what have I done 
 wrong? Please!
 
 Just a quick note I have not got a command line access to 
 the online
 server only using myphpadmin and I have tried getting a dump 
 using IE and
 Netscape  to see if it was IE messing the file up!
 
 Thanks a lot,
 
 Steve
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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




AW: [PHP-DB] strange behavior

2002-09-12 Thread Thomas Lamy

Hi,
this isn't essantially DB-related
It's a feature called transparent session id (activated at compile time with
--enable-trans-sid). No need for ?=session_name().'='.session_id()? in
most cases, as it is automatically added by PHP. And for the few times PHP
can not add session information, you may use the SID define, which is
automatically defined to session_name().session_id() if the user has turned
off cookies.

Read: http://php.net/session

Thomas

 -Ursprüngliche Nachricht-
 Von: Martin Adler [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 12. September 2002 14:34
 An: [EMAIL PROTECTED]
 Betreff: [PHP-DB] strange behavior
 
 
 Hi,
 
 i start a session on a entrypage with a form,
 and i wonder about the output to the browser.
 There appeared a input-field of the type hidden
 with the session-name as name and the
 session-id as value.
 How can I switch this PHP-behavior off?
 
 CODE
 td
   form name=focusedform
 action=index.php??=session_name().'='.session_id()? method=post
   input type=text name=auth_username size=22 maxlength=15
 /td
 
 
 OUTPUT
 ...
 td
   form name=focusedform
 action=index.php?PHPSESSID=5ac37e23f46a3c2c1388201e3f4a951f
 method=postinput type=hidden name=PHPSESSID
 value=5ac37e23f46a3c2c1388201e3f4a951f /
   input type=text name=auth_username size=22 
 maxlength=15
 /td
 ...
 
 
 greet
 Martin
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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




[PHP-DB] Are running sessions using a MySQL handler faster?

2002-08-21 Thread Jonathan Thomas

Good afternoon!

Quick performance question - I'm currently preparing the release of a new
website running on a Linux box written in PHP and MySQL with sessions
throughout.

I've read a bit about changing the PHP session handler to use a database vs.
the flat file method.

Does anyone have experience doing this?  Are there noticeable benefits of
making this change?  I realize that my /tmp folder will become quite
cluttered with session files, but hey - it's tmp so who cares!  :)  My
concern comes in with overall performance of the server - if one method is
better than the other.

Thanks for your feedback!
JT

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




[PHP-DB] libphp4.so, Sun Solaris 8, relocation error

2002-07-22 Thread Thomas Langås

OS:
Sun Solaris 8

Problem:
dilbert:/local/apache# bin/httpd  
Syntax error on line 244 of /local/apache/conf/httpd.conf:
Cannot load /local/apache/libexec/libphp4.so into server: ld.so.1: bin/httpd: fatal: 
relocation error: file 
/local/apache/libexec/libphp4.so: symbol __floatdidf: referenced symbol not found

Output from ldd:
dilbert:/usr/src/web/php-4.2.2# ldd -d  /local/apache/libexec/libphp4.so 
libdl.so.1 =/lib/libdl.so.1
libpam.so.1 =   /lib/libpam.so.1
libxmlrpc.so.0 =/local/lib/libxmlrpc.so.0
libexpat.so.0 = /local/lib/libexpat.so.0
libpdf.so.1 =   /local/lib/libpdf.so.1
libz.so.1 = /lib/libz.so.1
libsched.so.1 = /lib/libsched.so.1
libgen.so.1 =   /lib/libgen.so.1
libsocket.so.1 =/lib/libsocket.so.1
libnsl.so.1 =   /lib/libnsl.so.1
libmysqlclient.so.10 =  /local/lib/mysql/libmysqlclient.so.10
libldap.so.2 =  /local/lib/libldap.so.2
liblber.so.2 =  /local/lib/liblber.so.2
libintl.so.1 =  /lib/libintl.so.1
libt1.so.1 =/local/lib/libt1.so.1
libm.so.1 = /lib/libm.so.1
libxml2.so.2 =  /local/lib/libxml2.so.2
libgdbm.so.2 =  /local/lib/libgdbm.so.2
libcrypt_i.so.1 =   /lib/libcrypt_i.so.1
libresolv.so.2 =/lib/libresolv.so.2
libclntsh.so.8.0 =  /local/oracle/lib/libclntsh.so.8.0
libc.so.1 = /lib/libc.so.1
libmp.so.2 =/lib/libmp.so.2
libwtc8.so =/local/oracle/lib/libwtc8.so
libaio.so.1 =   /lib/libaio.so.1
/usr/platform/SUNW,Sun-Fire-280R/lib/libc_psr.so.1
symbol not found: __floatdidf   (/local/apache/libexec/libphp4.so)
symbol not found: ap_block_alarms   
(/local/apache/libexec/libphp4.so)
symbol not found: ap_unblock_alarms 
(/local/apache/libexec/libphp4.so)
symbol not found: ap_user_name  (/local/apache/libexec/libphp4.so)
symbol not found: ap_max_requests_per_child 
(/local/apache/libexec/libphp4.so)
symbol not found: ap_server_root
(/local/apache/libexec/libphp4.so)
symbol not found: ap_user_id(/local/apache/libexec/libphp4.so)
symbol not found: ap_group_id   (/local/apache/libexec/libphp4.so)
symbol not found: top_module(/local/apache/libexec/libphp4.so)


Output from crle:
dilbert:/usr/src/web/php-4.2.2# crle

Configuration file [3]: /var/ld/ld.config  
  Default Library Path (ELF):   
/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib
  Trusted Directories (ELF):
/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib

Command line:
  crle -c /var/ld/ld.config -l 
/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib -s 
/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib


Configure-line used:
./configure --with-mysql=/local --with-oracle=/local/oracle --with-ldap=/local 
--with-gd=/local --with-zlib 
--with-exec-dir=/local/bin --with-versioning --with-gdbm=/local --with-mod_charset 
--with-dbase --with-filepro 
--with-xml=/local --with-ttf --with-t1lib=/local --without-snmp --enable-calendar 
--enable-pic --enable-inline-optimization 
--enable-magic-quotes --enable-track-vars --enable-safe-mode --enable-sysvsem 
--enable-sysvshm --enable-trans-sid --enable-yp 
--enable-ftp --with-apxs=/local/apache/bin/apxs --enable-static --with-sablot=/local 
--with-config-file-path=/local/apache/conf/php4 --with-pdflib=shared --enable-bcmath 
--with-sysvsem --with-iconv 
--with-gettext --enable-shared --with-xslt=sablot --with-curl=/local 
--with-xmlrpc=/local --with-dom=/local 
--enable-xlst=/local --with-openssl=/local --prefix=/local --with-pdflib=/local 
--with-expat-dir=/local --enable-sigchild

A few environment vars:
LD_LIBRARY_PATH=/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib
PATH=/bin:/usr/bin:/usr/ucb:/usr/bin/X11:/usr/local/bin:/store/bin:/usr/ccs/bin:/sbin:/usr/sbin

Anyone around with a possible solution, or does anyone
need more info to help solve the problem?  I would be
happy to provide more info, and I would be very
gratefull for a solution to this problem.


-- 
Thomas

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




[PHP-DB] Saving to local computer

2002-07-09 Thread Thomas \omega\ Henning

Hello all,

Im working on a project in witch i have to save to the users computer from
where it views the php site on the server. Better explained in this graph:

Im connection from 192.168.10.11 to 192.168.10.1 and the project is on
192.168.10.1. And from the project i need to save to 192.168.10.11's
computer to C:\program files\ dir. Any way i can do this??

Thomas Henning



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




[PHP-DB] system help!

2002-07-03 Thread Thomas \omega\ Henning

hey all,

i have this
?php
$today = getdate();
$month = $today['mon'];
$day = $today['mday'];
$year = $today['year'];
$date=$month.-.$day;

$command=mysqldump -uroot --password=* iktato intrat2003 tt.sql;
$test=system($command);
?
When $command=mysqldump -uroot --password=* iktato intrat2003 ; it
works and
when $command=mysqldump -uroot --password=* iktato intrat2003 tt.sql;
it doesn't work.
BUT!!!
i have made a consol script that runs a linux command from a normal input
text box. With that same command it executes it and makes the tt.sql. And im
not using exec() because i need to see the results of it thats why i use
system()

help pls

Thomas omega Henning








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




[PHP-DB] Syncing two tables in mysql

2002-05-11 Thread Thomas \omega\ Henning

Hey all,

Is there a way i can sync two tables in mysql on two totaly different
servers over the internet via php4 or mysql?
I'm using php4.0.6

thanks

Thomas omega Henning



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




Re: [PHP-DB] Syncing two tables in mysql

2002-05-11 Thread Thomas \omega\ Henning

And how can i use it?
Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Sunday 12 May 2002 01:34, Thomas \omega\ Henning wrote:
  Hey all,
 
  Is there a way i can sync two tables in mysql on two totaly different
  servers over the internet via php4 or mysql?
  I'm using php4.0.6

 mysql has it's own replication mechanism.

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


 /*
 In Christianity neither morality nor religion come into contact with
reality
 at any point.
 -- Friedrich Nietzsche
 */



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




Re: [PHP-DB] Problem

2002-04-23 Thread Thomas \omega\ Henning

well sorry 2 say but it was just an incompability between php and mysql php
4.1.2 fixed it :)
David Robley [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In article [EMAIL PROTECTED], [EMAIL PROTECTED]
 (Thomas \Omega\ Henning) says...
  no everything i try to do same old story sql error
  Richard Emery [EMAIL PROTECTED] wrote in message
  004e01c1ea1b$b3dff4e0$0200a8c0@C1525232">news:004e01c1ea1b$b3dff4e0$0200a8c0@C1525232...
   mysql permissions?
  
   you gave us no info...we can give you no answer
   - Original Message -
   From: Thomas omega Henning [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Monday, April 22, 2002 11:25 AM
   Subject: [PHP-DB] Problem
  
  
   Ok i have a problem big one. I'm using php 4.0.6 and mysql 3.23 both
win.
   And i use PhpMyAdmin to fill my database but MySQL reject every query
i
  post
   to it any idea why?
  
   Thanks
  
   Thomas omega Henning

 Well, the exact error and circumstances in which it occurs might be
 useful.

 --
 David Robley
 Temporary Kiwi!

 Quod subigo farinam



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




[PHP-DB] Problem

2002-04-22 Thread Thomas \omega\ Henning

Ok i have a problem big one. I'm using php 4.0.6 and mysql 3.23 both win.
And i use PhpMyAdmin to fill my database but MySQL reject every query i post
to it any idea why?

Thanks

Thomas omega Henning




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




AW: [PHP-DB] multiple inserts

2002-04-20 Thread Thomas Schön

i think, your sql-statement isn´t correct.
Maybe you don´t insert the right count of values, or you try to insert NULL
in a NOT NULL-defined column.
Try to echo the statement and run it with phpMyAdmin, wich will show you
the position of your error in your statement.

mysql_insert_id() gives you the insert-id of your last successfull INSERT.

Tom

 I have the following insert :
 mysql_connect( localhost, ,  );
   mysql_select_db(  );

   mysql_query(INSERT INTO music_album VALUES
 (NULL, '$artist_id' ,'$album' ,NULL ,NULL));

   mysql_query(INSERT INTO music_songs VALUES
 (NULL ,NULL ,NULL ,NULL ,'$songname' ,'$lyrics'));

 When I run this, the first insert works alright but the second insert
 does nothing. What am I doing wrong ?
  How do I do a mysql_insert_id()?



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



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




[PHP-DB] cutting off zeros 10.00 to 10

2002-02-06 Thread Thomas Murphy

Hallo,

i was wondering if there is a built-in function in php that just cuts
off not needed zeros from float-numbers (like changing 1.90 to 1.9
or 10.00 to 10).
I get this numbers from a mysql-database, perhaps there even is a
mysql-function for this???

thank you very much,
Thomas Murphy

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




Re: [PHP-DB] cutting off zeros 10.00 to 10

2002-02-06 Thread Thomas Murphy

Hello Mike,

Mike Maltese wrote:
 
 I tested this and it seems to work:
 
 $n = 1.90;
 
 for($i=strlen($n);$i0;$i--){
 if(substr($n,$i,1) == 0){
 $n = substr($n,0,(strlen($n))-1);
 }else{
 break;
 }
 }
 
 No charge...this time. =)

thank you very much. :)

bye,
Thomas Murphy

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




Re: [PHP-DB] cutting off zeros 10.00 to 10

2002-02-06 Thread Thomas Murphy

i still have some problems on typecasting my float-variable to a string
variable.
i used something like this:

$n = $row[Points];
settype($n,string);

but the zeros are still there - as if $n is still handled as a float
number not a string.
with $n = 1.90 it's converted to 1.9 without problems...

bye,
Thomas Murphy

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




[PHP-DB] Re: uploading

2002-01-28 Thread Thomas \omega\ Henning

thanks alot it helped
Thomas Omega Henning [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello how can i upload something from my hdd to the webserver using php?

 note: don't have ftp on the machine!!

 Thanks

 Thomas omega Henning





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

2002-01-27 Thread Thomas \omega\ Henning

Hello how can i upload something from my hdd to the webserver using php?

note: don't have ftp on the machine!!

Thanks

Thomas omega Henning



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




AW: [PHP-DB] Pictures+MySQL+PHP

2002-01-27 Thread Thomas Lamy



 -Ursprüngliche Nachricht-
 Von: Michael Waples [mailto:[EMAIL PROTECTED]]
 Gesendet: Samstag, 26. Januar 2002 09:54
 An: [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] Pictures+MySQL+PHP
 
 
 Ck Raju wrote:
  
   that I changed my mind. Gurhan OzenStoring images in the 
 database is not a
   good idea , just store the path of Gurhan Ozenthe images 
 in the database
   and keep your images in your hard disk... Gurhan Ozen
  
  Since everything is on hard-disk, I personally feel, the 
 image can be stored
  anywhere. BLOB should be easier when doing a mysqldump, or 
 when replication
  is needed.
  
  Anywhere else go in for storing images separately.
  Raju
 I prefer storing images out of the dbserver to save on server 
 load. You
 can serve those images with a http server like thttpd, boa etc which
 will serve images quicker and with a lighter load.
 If you need replication just use rsync to move your images around.
 
 But if server load isn't an issue a database is as good as any place.

I did a community software where users can upload pics all over the
application. It is run on LVS cluster, so nobody can say to which of the
cluster members the pic is uploaded to. NFS, or unattended rsync/scp has
been denied by security policy, so the only way was to store the pics in the
DB (mysql).
I also did some performance measures, and, as all the pic requests had to go
thru php (for member verification), there was practically no performance
drawback; in fact, storing the pics in database was a bit quicker than
getting them through the filesystem when the number of pics went above
100,000 :-)
And now it is very easy to do full backups, and no problem with db/fs
getting out of sync.
Only one thing has given me a hard time: The first time I stored all 5
instances of an image (thumb plus 4 other resolutions) in the same db table,
but mysql choked on it when it became about 200 mb (the whole server did not
respond or respond veeery slow). I split the whole thing into 5 tables, and
now it runs like a charm.

Thomas  

--
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] iODBC module for PHP on linux

2002-01-21 Thread Thomas Spellman

Hi,

I'd like to use iODBC in mod_php (Apache DSO) on linux to access an
Access database running on a Windows box elsewhere.  I'm using an RPM of
mod_php.  Is it possible to compile the iODBC support as a PHP module
without having to recompile mod_php?  If so, how?  Does iODBC have to be
compiled with support for php?

Thanks for any help,

Thomas


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

2002-01-17 Thread Thomas \omega\ Henning

can someone tell me a decrypt and crypt fuction besides in the mcrypt pack?



-- 
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] crypt and decrypt and xor

2002-01-15 Thread Thomas \omega\ Henning

Hello All,

Does PHP have a crypt and decrypt algorithm?
Is xor supported by php and can you give me some examples for it?

Thanks

Thomas omega Henning



-- 
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] Breaking strings up

2002-01-14 Thread Thomas \omega\ Henning

Hello,

I saw here somewhere a functions that breakes up a string at a nother string
like
120,120,122 and break up at ,
and it would result
$var[0]=120;
$var[1]=120;
$var[2]=122;

Thanks for the info



-- 
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: Tricky Quiestion!!!

2002-01-14 Thread Thomas \omega\ Henning

Ok i got here:
When i type the ecrypted msg oomoeogoao ohooomoeo it types out omega hmeo
code:
elseif($cmd==@)

{

$sep=substr($enc,0,1);

$denc=explode($sep,$enc);

for($i=0;$istrlen($enc);$i++)

{

$test[]=substr($enc,$i,1);

$tests=$test[$i-2].$test[$i-1].$test[$i];

$testb=substr($enc,0,1).substr($enc,0,1).substr($enc,0,1);

if($tests==$testb){$dencf=$dencf.substr($enc,0,1).$denc[$i];}

else{$dencf=$dencf.$denc[$i];}

}

$dencf=substr($enc,0,1).$dencf;

irc_put_message(PRIVMSG $nickto :$nick,encrypted message $enc:$dencf);

}




-- 
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] Defining Arrays

2002-01-13 Thread Thomas \omega\ Henning

Hello,

I'm curently working on an Encryption Bot for IRC that sends encrypted
messages to other bots linked 2 it and users that are log into it.
How i define an Array so i can use something like this
?
$text=hello;
for ($i=0;$istrlen($text);$i++) {
$denc[$i]=substr($text,$i,1);
}
echo($denc[1]);
?
Theoraticly (in C++ point of view) that should print out h.
Any idias helps alot

Thanks

Thomas omega Henning




-- 
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: Defining Arrays

2002-01-13 Thread Thomas \omega\ Henning

Something i forgot
when i echo($denc[1]); then it types Array out !!!
Thomas Omega Henning [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 I'm curently working on an Encryption Bot for IRC that sends encrypted
 messages to other bots linked 2 it and users that are log into it.
 How i define an Array so i can use something like this
 ?
 $text=hello;
 for ($i=0;$istrlen($text);$i++) {
 $denc[$i]=substr($text,$i,1);
 }
 echo($denc[1]);
 ?
 Theoraticly (in C++ point of view) that should print out h.
 Any idias helps alot

 Thanks

 Thomas omega Henning






-- 
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: Urgent!!!

2002-01-03 Thread Thomas \omega\ Henning

Sorry but I don't have the query done yet . But maybe later I will have it
done but I don't know how to use the substr command in mySQL . If you tell
me how to use it I will post it on the forum.

Thomas omega Henning
George Nicolae [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 and who looks the query with substr the date so i get only the year?
Type
 the exact query you make.

 --


 Best regards,
 George Nicolae
 IT Manager
 ___
 X-Playin - Professional Web Design
 www.x-playin.f2s.com



 Thomas Omega Henning [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I forgot to type in something if i substr the date so i get only the
year
  from it then is it possible?
  George Nicolae [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   you can't make this query because type mismatches.
  
  
   --
  
  
   Best regards,
   George Nicolae
   IT Manager
   ___
   X-Playin - Professional Web Design
   www.x-playin.f2s.com
  
  
  
   Thomas Omega Henning [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello,
   
Is it possible to order the table somethin like this
'select * from intrat order by idatum+iszam DESC; '
where idatum is date
and iszam is int
   
thanks
   
Thomas omega Henning
   
   
   
  
  
 
 





-- 
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] Urgent!!!

2002-01-02 Thread Thomas \omega\ Henning

Hello,

Is it possible to order the table somethin like this
'select * from intrat order by idatum+iszam DESC; '
where idatum is date
and iszam is int

thanks

Thomas omega Henning




-- 
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: Urgent!!!

2002-01-02 Thread Thomas \omega\ Henning

I forgot to type in something if i substr the date so i get only the year
from it then is it possible?
George Nicolae [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 you can't make this query because type mismatches.


 --


 Best regards,
 George Nicolae
 IT Manager
 ___
 X-Playin - Professional Web Design
 www.x-playin.f2s.com



 Thomas Omega Henning [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
 
  Is it possible to order the table somethin like this
  'select * from intrat order by idatum+iszam DESC; '
  where idatum is date
  and iszam is int
 
  thanks
 
  Thomas omega Henning
 
 
 





-- 
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-WIN] MSSQL connect

2001-12-26 Thread Thomas \omega\ Henning

?php
$h = server adr; //don't forget 2 change this
$u = user; //don't forget 2 chage this
$p = passw; //don't forget 2 change this
$b = db; //don't forget 2 change this
$connexion = mssql_connect($h, $u, $p);

 Why do you uses quotes here?

mssql_select_db($b);

$sql_temp = select * from test;
//.
$result = mssql_query($sql_temp);
//  ^^

//??

mssql_close($connexion);
?

Here is the problem $sql != $sql_temp
so the $result = NULL; because mssql_query( ) has no query to send to the
MsSQL server.
This should work try it out!!!

Thomas omega Henning




-- 
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] MyODBC on Linux or Windows

2001-12-26 Thread Thomas \omega\ Henning

Hello All,

I'v writen a program in PHP4.0.6+MySQL and its working on a linux machine.
I'm trying to print from Crystal Report through MyODBC. Where i have to
install MyODBC on my linux machine or windows machine?
Thanks for all help

Thomas omega Henning



-- 
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-WIN] MSSQL connect

2001-12-26 Thread Thomas \omega\ Henning

I don't know who's a moron that can;t even see straight
B.A.T. Svensson [EMAIL PROTECTED] wrote in message
27E647E5629ED211BF78009027289C6302157DAB@mail1">news:27E647E5629ED211BF78009027289C6302157DAB@mail1...
 You must be an extremely intelligent person, almost literary quoting my
 answer, and then pinpointing down things I already pointed out! Moron...

 From: Thomas omega Henning
 Sent: Wednesday, December 26, 2001 8:50 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Subject: Re: [PHP-WIN] MSSQL connect
 
 
 ?php
 $h = server adr; //don't forget 2 change this
 $u = user; //don't forget 2 chage this
 $p = passw; //don't forget 2 change this
 $b = db; //don't forget 2 change this
 $connexion = mssql_connect($h, $u, $p);
 
  Why do you uses quotes here?
 
 mssql_select_db($b);
 
 $sql_temp = select * from test;
 //.
 $result = mssql_query($sql_temp);
 //  ^^
 
 //??
 
 mssql_close($connexion);
 ?
 
 Here is the problem $sql != $sql_temp
 so the $result = NULL; because mssql_query( ) has no query
 to send to the MsSQL server.
 This should work try it out!!!
 
 Thomas omega Henning



-- 
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] EZ Question...I think

2001-12-03 Thread Thomas

I have looked into some source code that I found, but I'm a newbie at this,
and don't understand..

if ( 0 == $this-link_id) {

In this statment, what does the '-' repersent?  this statment (operator?)
occurs alot in this code that I have, but I can't find the definition on any
site...can anyone help?

Please reply to group.

Thanks.

Thomas



-- 
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: EZ Question...I think

2001-12-03 Thread Thomas

Thanks everyone.

Appreciate it.


Thomas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have looked into some source code that I found, but I'm a newbie at
this,
 and don't understand..

 if ( 0 == $this-link_id) {

 In this statment, what does the '-' repersent?  this statment (operator?)
 occurs alot in this code that I have, but I can't find the definition on
any
 site...can anyone help?

 Please reply to group.

 Thanks.

 Thomas





-- 
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] wildcard in mysql search with php

2001-10-18 Thread Thomas \omega\ Henning

Hello all,

Is there a way to use wildcards in search in a mySQL db?
e.g. I have a dbase of over 24000 records and i can only search exact
matches is there a way to search something like this : *admin* in mySQL? Or
i have to do it by hand in PHP?

Thanks
Sir Thomas omega Henning



-- 
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: Highlighting search results ???

2001-10-18 Thread Thomas \omega\ Henning

Thanks Tomy for the idia i could use the same code for my search programs

Sir Thomas omega Henning
Chris Payne [EMAIL PROTECTED] wrote in message
news:000c01c15736$49ea31e0$0200a8c0@chris...
Hi there everyone,

I'm becoming regular on here hehehe :-)

I have my search engine working great (Abit like Google) but how do I
highlight in the results the keywords I searched for?  This is a must for my
search engine.

Thank you for your help in the past (And more than likely in the future
hehehe :-)

Regards

Chris Payne
[EMAIL PROTECTED]
http://www.planetoxygene.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] wildcard in mysql search with php

2001-10-18 Thread Thomas \omega\ Henning

thanks
Dave Watkinson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
select columnlist from tablename where columnname like
'%searchword%'


RTFM!!!



-Original Message-
From: Thomas omega Henning [mailto:[EMAIL PROTECTED]]
Sent: 18 October 2001 14:58
To: [EMAIL PROTECTED]
Subject: [PHP-DB] wildcard in mysql search with php


Hello all,

Is there a way to use wildcards in search in a mySQL db?
e.g. I have a dbase of over 24000 records and i can only search exact
matches is there a way to search something like this : *admin* in mySQL?
Or
i have to do it by hand in PHP?

Thanks
Sir Thomas omega Henning



--
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] Sybase Stored Procedures

2001-10-02 Thread Thomas Janke

hello,

I would like to use sybase stored procedures and need to know, in what
way they are supportet in PHP. In the manual, one can read that stored
procedures are not yet fully supported. Does anybody have any newer
information on what Sybase features can be used with PHP4?

Thank you very much for your help.

Yours
Thomas

-- 
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] Compiled dBase Extension for Win32?

2001-09-13 Thread Thomas Kaeser

Hi!

I am trying to find a compiled dBase library (php_dbase.dll) for PHP4;
found many hints, but nothing useful.

Thanks for your help!

Thomas


--
Thomas Kaeser
[EMAIL PROTECTED]

***
Courage is not the absence of fear, but rather the judgement that something
else is more important than fear.





-- 
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: Mysql to CSV

2001-08-25 Thread Thomas Spellman

Check the PHP Classes site, I think I remember seeing one there. 

http://phpclasses.upperdesign.com/browse.html


-Original Message-
From: Higgy [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 25, 2001 4:51 AM
To: [EMAIL PROTECTED]
Subject: Mysql to CSV


Hi,
Does any one know of a script that will do this. I can use the phpadmin
program,  however I simply need a script that will do it after one click.

Stephen Higgins




-- 
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-SQL, PHP, IIS

2001-08-07 Thread Thomas Winkler

Hi.,

I'm currently using an IIS5 (W2k) with php4.0.6 (CGI) and MS SQL Server
2000.
I've run into problems when fetching fileds of the type datetime from the
database.
When using the MS SQL Query Analyzer I get my dates formated like this out
of my database: 2001-06-08 08:14:40.000
When using php to send my queries (mssql_query) to the database I get the
dates formated like this: 08 06 2001 8:14
But in my application I'd need the same format as i get it in the
Query-Analyzer. Any idea how to achive that or what's going wrong?
Besides all that: When I'm using the unified ODBC functions of PHP I get the
date in the same format as from the Query Analyzer. Might there be a bug in
PHP's mssql_ functions (well some might call a reformat of the datatype a
feature but I don't...)?

Thanks in advance for your help and suggestions,
Tom Winkler






-- 
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] Retrieving Rows - Can I Change The Order?

2001-07-28 Thread Thomas Lamy

 Von: Caleb Walker [mailto:[EMAIL PROTECTED]]
 Gesendet: Samstag, 28. Juli 2001 08:26
 An: Dave Watkinson; PHP-MySQL List
 Betreff: Re: [PHP-DB] Retrieving Rows - Can I Change The Order?
 
 
 
  Now then, I have changed a column in the table, and the 
 only way I found to
  change a data type is to delete the offending column and 
 then add it again.
 
  When I do the select now the new column, which was at 
 $row[3] is now always
  $row[39]. I don't mind this, because I know where it is, 
 but is there any
  way I can make it appear at $row[3] again? I'm sure you can 
 imagine when
  there are quite a few pages using this code it's easier to 
 reorder the
  columns in the select than to change all my if() codes!
 
You should use mysql_fetch_array() instead of mysql_fetch_row(), so you can
refer to your columns by name, as in:
$q = mysql_query(select id,name from address;);
$a = mysql_fetch_array ($q);
== now you can use $a['id'] and $a['name'] to get the field's values.

I found it always good practice to name all affected columns in a query, so
you have no pain  if your columns get mixed by db alters.


Thomas


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

2001-07-16 Thread Thomas

Why not simply : [a-zA-Z0-9]+ that would match any sequence of letters or
numbers ?

- Mensaje original -
De: Jennifer Arcino Demeterio [EMAIL PROTECTED]
Para: [EMAIL PROTECTED]
Enviado: lundi 16 juillet 2001 04:35
Asunto: [PHP-DB] problem with regular expression


i have a script to identify if the input is a combination of letters and
numbers

if (eregi([a-zA-Z0-9][0-9]+[a-zA-Z][0-9a-zA-Z],$fieldvalue))
print alphanumeric
} else {
not an alphanumeric
}

my problem is, when the string ends with a number, for example hello123, it
says not an alpanumeric ... it works fine when the number is placed before
the letters or in between letters ... why is that?

i would really appreciate your help, thanks very much

:)



-- 
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] Truncated data retrieved from MSSQL Server

2001-07-14 Thread Thomas Merlin

Hello,

I'm trying to retrieve data from a table sitting on a MSSQL Server Database
but the query result is always truncated over 255 characters...

PHP 4.05 is running on a Linux box

The column is a varchar 5000

Thanks for any help.

Thomas.



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

No, with an image, the value captured are the coordinates x and y above the
image this means that if your variable is called submit, the two variables
$submit_x and $submit_y are set.



- Mensaje original -
De: Jan de Koster [EMAIL PROTECTED]
Para: [EMAIL PROTECTED]
Enviado: vendredi 22 juin 2001 10:10
Asunto: [PHP-DB] submitbutton/imagebutton


 Hi,

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

 What I want to do is change the 'type=submit' of a submit button to
 'type=image' so I can control the looks of the button.

 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.

 Am I overlooking something or is it just something that doesn't work?

 jan


 --
 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] imap problem

2001-06-21 Thread Thomas

Did you compile php with the --with-imap option ?
Because generally, this type of message happens when the function is not
installed.

- Mensaje original -
De: vipin chandran [EMAIL PROTECTED]
Para: [EMAIL PROTECTED]
Enviado: mercredi 20 juin 2001 14:54
Asunto: [PHP-DB] imap problem



 Hi,
 I am developing an email reader for IMAP/POP3. But I am getting the
 following error when trying to excute the file. I have removed the
 comment from the IMAP extensions in the php.ini.

 Fatal error: Call to undefined function: imap_open() in conn.inc on
 line 6

 Contents of conn.inc is as below :

 ?
   $username = whoosh_vc;
   $password = crossroads;
   $mailserver = {pop.postmark.net/pop3:110}INBOX;

   $link = imap_open($mailserver,$username,$password);
 ?

 Please help.
 Thanx in advance.
 vipin chandran
 [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]




AW: [PHP-DB] Variable passing

2001-04-24 Thread Thomas Lamy

 Johannes Janson [mailto:[EMAIL PROTECTED]] wrote:
 
 You can output the passed varibles from the previous page
 in an input type=hidden  in the form of the following page.
 
 Johannes
 
But be sure to urlencode() your data before putting in the hidden fields,
and decode them when you enter the next page.

Thomas
 
 Brinzoi Constantin Aurelian [EMAIL PROTECTED] schrieb im 
 Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi !
 
  Here is the problem: I got 8 pages, shown one after 
 another. Each have 2
  buttons (one for continue and one for abort). When I click 
 to Continue I
  go to the next page. On the last page I have to submit ALL 
 variables from
  these 8 pages to the database.
 
  My test shown that only the variables from the last page 
 are filled-in and
  otherones are empty.
 
  I have tried with another php page that includes all 8 -
  include(page...). Worthless!
 
  What can I do?
 
  TIA,
 
  Constantin Brinzoi
  Dept. Sondaje
  IRECSON
 
 
  --
  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]




AW: [PHP-DB] syntax error - -- agghhh!

2001-04-24 Thread Thomas Lamy

 Marc S. Bragg [mailto:[EMAIL PROTECTED]] wrote:

 
 Hi
 
 Anyone have any idea of what the syntax error in this statement is?
 
 else if (($op == ds)  ($action == sub)  ($password == 
 $passnog)
  ($password) 
 (!eregi(^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4
 }$,$email))
 {
 
 It worked fine until I added the tricky part:
 
 
 (!eregi(^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4
 }$,$email)
 
You are missing a ) to close the if expression

Thomas

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




AW: [PHP-DB] Concurrent update to database (PostgreSQL or MySQL) ??

2001-04-18 Thread Thomas Lamy

Another way is to keep another unique value inside the table to be updated
and remember it.
When needed, I add a second unique column to the table (in my case a
char(64)) which is filled with the current timestamp and some md5 checksum.
I select this value before the update, pass it along with the HTML form,
and, before updating, I re-select the row to be updated and compare the
keys. If the comparision fails, the user is presented a warning message,
else I do the update (the user's data and a new generated stamp-value) with
the primary key _and_ the original stamp in the where clause. Then I check
if my new stamp made it to the table, or present another warning.

A sample:

Table atable:
id int not null primary key
stamp  char(64) not null unique
avalue int

select id,stamp,avalue from atable where id=1   (select data for update)
build html form with "id" and "stamp" as hidden values

select stamp from atable where id=the_id
if stamp(form) != stamp(db)
  error (e.g. start from beginning)
else
  construct new_stamp
  update atable set avalue=new,stamp=new_stamp where id=the_id AND
stamp=old_stamp
  select stamp from atable where id=the_id
  if stamp(db) != new_stamp
error
  endif
endif

It's a bit of work, but it had never let me down.

Thomas



id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
  Is what I use in the WHERE clause to update data
ts CHAR(32) NOT NULL UNIQUE
  I 
 -Ursprngliche Nachricht-
 Von: Doug Semig [mailto:[EMAIL PROTECTED]]
 Gesendet: Mittwoch, 18. April 2001 20:48
 An: [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] Concurrent update to database (PostgreSQL or
 MySQL) ??
 
 
 As others have mentioned, this is a tricky thing to do.
 
 What others haven't mentioned is a way to do it.
 
 Let's say you just showed the update form to two users.  It 
 contains the
 fields that they are allowed to update and the values in 
 those fields had
 been retreived from the database.
 
 Both users see a form like this:
 
 Today's High Temperature
 
 City: Detroit
 Temp (degrees F): 47
 
( Submit )
 
 The city field is not available for update (presumably the editor/user
 selected it off of a previous menu), and their task is to 
 update today's
 high temperature for Detroit.  One of the editors has 
 information that the
 high temperature reached 49 degrees F, and the other editor 
 has information
 that the high temperature has reached 50.  (Perhaps one of 
 the editors is
 overworked and hadn't gotten to enter the new high, or the 
 temperature is
 changing very quickly.)
 
 So one of the people enter 50 and the other enters 49.  Both 
 hit submit.
 
 What needs to be done right at that moment to protect it from 
 changing the
 value to 50 degrees (which is the correct, most recent, data) and then
 immediately changing the value to 49 degrees (which is now 
 out of date)?
 
 Basically, you have to pass the original value to the script 
 that is the
 ACTION of the HTML form.  This way, you have the original 
 value that may
 have been updated and the new value.
 
 The first thing the HTML form's ACTION script has to do is 
 get the record
 from the database again.  (Use SELECT ... FOR UPDATE if 
 available, so the
 RDBMS might lock the row.)  If the value you get from the 
 SELECT is the
 same as the original value, go ahead and run the UPDATE to 
 change the value
 to the new value.  If not, then generate and display a screen 
 telling the
 editor that the value has been updated by someone else...you 
 can show the
 value and ask if they want to proceed with the update, but 
 that's all up to
 you and/or your interface designers.
 
 This is all similar to how folks design old fashioned screen-oriented
 database systems (like with CICS).
 
 Good luck,
 Doug
 
 At 01:47 PM 4/18/01 +0200, Nicolas Guilhot wrote:
 Hi,
 
 How can I avoid two or more users to update the same record 
 at the same time
 ?
 
 Ideally, I would like to lock the record when a user open it for
 modification. So if another user try to open the same record 
 he'll be warned
 or get record values as read only. Is this possible and how 
 to do it with
 PHP ?? How can I know that the user that has locked the 
 record has finished
 with it, if he never commits his changes ? Is there an FAQ 
 about this ?
 
 Regards,
 
 Nicolas
 
 
 
 
 -- 
 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] oracle 8i client/ PHP 4.0.4pl1 breaks

2001-04-12 Thread Dave Thomas

 
Here's the scoop:
 
Goal: to connect apache 1.3.19/PHP to remote Oracle server.
 
Background: I downloaded Oracle 8.1.7 and installed the default Client configuration.  
Machine is an SMP Mandrake 7.0 Linux 2.2.14.  PHP is  4.0.4pl1.
 
Synopsis: I configure and make php even with the cleanest configuration--
./configure --with-apxs --without-xml --with-oracle=/var/oracle 
--with-oci8=/var/oracle --without-mysql
It finds everything, make runs fine, install runs fine.  I try to load apache, it 
immediately dies without a trace in the logs.  Seems to be the libphp4.so the's the 
cause.  Should I suspect bad Oracle link libraries?
 
Dave Thomas
Chief Software Architect
BCD Enterprises, Inc.  
  


-- 
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 and MS SQL 2000

2001-03-25 Thread Thomas W. Badera

Hello -

I've been using PHP4 for a while with my MS SQL7 server, but recently
upgraded to Win2k and SQL2k.  Now, I can no longer connect via user/pass.  I
get the following error:

Warning: MS SQL message: Login failed for user '[EMAIL PROTECTED]'.
Reason: Not associated with a trusted SQL Server connection. (severity 14)
in D:\Webs\sportspotonline.com\listItems.php3 on line 27

Any suggestions would be greatly appreciated...

Thanks,
--TWB


---
Thomas W. Badera
WebTeam Manager
Clarkson University
 [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]