[PHP-DB] Apache HTTP Server has encountered a problem and needs to close

2008-11-12 Thread S, Murgesan (GE, Corporate, consultant)
Hi,

 

I have posted an error in  http://bugs.php.net/?id=46519

Please help me to resolve it.

 

Thanks  Regards,

Murugesan.S,

TCS Consultant,

GE Corporate

DC:0809-0246

Mobile:+91-9920185048

 



[PHP-DB] ? SELECT TABLE Command

2007-09-10 Thread Alec S.
Hi,

I've got a PHP program I wrote a year or so ago with the oddest line of code.  I
know I didn't come up with it myself; I must have adapted it from a book or
something, but I have checked all the books it could have come from and could
not find it in any of them, nor can I find any such command anywhere else.  It
is an SQL query (probably MySQL, but perhaps SQLite or possibly even PGSQL or
mSQL):

$query=SELECT TABLE $tablename;;
if (mysql_query($query, $link)) {
 echo($indent.The table, '$tablename', was successfully opened.br /\n);
}

To make things even stranger, it works fine in the original program that I put
it in (although what, if anything, it does is beyond me), but fails when I try
it in another program (yes, I took care of $tablename).


Does anyone have any idea where this bizarre piece of code came from, what it
does, if it's valid, or why it works even though such a command does not even
seem to exist?  This is has had me baffled for several months now.


Thanks.

-- 
Mike W.

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



[PHP-DB] Assertion failed: LDAP_VALID( ld ), file getentry.c

2007-06-14 Thread Sujay S A
*** DISCLAIMER: This email and any files transmitted with it are privileged 
and confidential information and intended solely for the use of the individual 
or entity to which they are addressed. If you are not the intended recipient, 
please notify the sender by e-mail and delete the original message. Further, 
you are not to copy, disclose, or distribute this e-mail or its contents to any 
other person and any such actions are unlawful. This e-mail may contain 
viruses. Torry Harris Business Solutions has taken every reasonable precaution 
to minimize this risk, but is not liable for any damage you may sustain as a 
result of any virus in this e-mail.  The recipient should check this email and 
any attachments for the presence of viruses. THBS reserves the right to monitor 
and review the content of all messages sent to or from this e-mail 
address

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

[PHP-DB] PHP and DBISAM

2007-02-14 Thread Markus S�lkner
Hi!

Is there a possibility to use php with a dbisam db? We use a programm based 
on a dbisam db and we have to use php to enter data in to this db.

Best regards

markus sölkner
:mediasoft kurz kg
au 16
a-8783 gaishorn am see
fax.: +43 (0) 3617/2691-2
mobil: +43 (0) 676/84 21 65 205
e-mail: [EMAIL PROTECTED]
home: www.mediasoft.at 

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



[PHP-DB] X Tiger 10.4.5 + phpBB2 + MySQL 5 + Can't Connect Issue!

2006-03-06 Thread m i l e s

Hi,

Im getting the following: Warning: mysql_connect(): Can't connect to  
local MySQL server through socket...etc.


NOTES:

1.) MySQL 5 is running fine.
2.) Im able to connect to it via Navicat.
3.) I run Lasso on the same host, I know that I can pull and post  
data to and from MySQL. So its NOT mysql. Its PHP.


I ran across a few postings from Apple and others that had SIMILAR  
problems, however those solutions are for MySQL 4 not MySQL 5. Seems  
to be bit of confusion about how to solve this problem. I tried what  
apple suggested...and that FAILED:


http://docs.info.apple.com/article.html?artnum=301457

So now Im asking you good people, who actually BUILT the damn...ahem  
wrote the software. Im at whits end and I need to get this up and  
running.


All I did was update from 10.4.4 to 10.4.5 and now PHP will not talk  
to MySQL at all. Ok...so what's the solution folks ? Anyone ?  
Buehler ? Buehler 


Thanks ahead of time

M i l e s.

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



[PHP-DB] X Tiger 10.4.5 + phpBB2 + MySQL 5 + Can't Connect Issue! - SOLVED!

2006-03-06 Thread m i l e s

Hi,

Figured it out:

Apple wiped out the location of the socket.

they wanted '/var/mysql/mysql.sock'

it should be: '/tmp/mysql.sock'

Problem solved.

M i l e s.

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



Re: [PHP-DB] novice on table design

2005-05-14 Thread Tony S. Wu
actually, no, Shop, Employee, and Customer are not distinct.
in your instance they are the same type of entry.
don't distinguish them by tables, rather use a column to hold some sort 
of an ID for each type.
of course you'll end up with a table with many columns, and many of 
them will be null depending on which type an entry is.
but with this approach, you can easily associate with an address table.

Tony S. Wu
[EMAIL PROTECTED]

On May 14, 2005, at 4:49 AM, tony yau wrote:
Hi Miguel,
Thanks for the reply.
the non-customer is actually a Shop, so Employee, Customer and 
Shop are
distinct enough to have their own tables. Now they all have an 
Address, and
the problem is how do I allow multiple addresses for each these 
'people'
(without using
a lookup table)

tony.
Miguel Guirao [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
The schema of your table is wrong, is you do bnormalize it you will 
find
out
that you need two tables for this approach.
One table for your people and another one for the n addresses of your
people.
If you keep your current schema, you will have as many rows for one 
person
as many addresses for that person you have, and you will be 
duplicating
many
fields. So you must split your tables, one for your people and 
another for
your people's addresses.

-Original Message-
From: tony yau [mailto:[EMAIL PROTECTED]
Sent: Viernes, 13 de Mayo de 2005 09:27 a.m.
To: php-db@lists.php.net
Subject: [PHP-DB] novice on table design

Hi all,
I have the following tables
EmployeeCustomernon-Customer
Address
=======
pkey pkeypkey
pkey
number type type
...
payrate grantcapital
I need to allow the three types of people to have n addresses, so I've
added
a type to distinguish the 3 types of people and their respective pkey 
onto
address table.

Address
=
pkey
...
type(either Employee, Customer or non-Customer etc)
fkey(the pkey of Employee, Customer or non-Customer etc)
I know this design looks awkward but it does have the advantage of 
having
less tables otherwise.
BUT somehow it doesn't feel right. Can someone points me its pros and
cons.
thanks all.
Tony Yau
--
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] How to process a query form with CHECKBOX Please help

2004-12-27 Thread S Kumar
Dear group, 
 I am a novice programmer started doing php to process
a query form of my patients.  

I have a database and one table in it deals with my
patient information.  Depending on their condition I
divided their age groups into 3 categories. In my
database a table patient_data has a column age_group
and a patient can be any one of young, middle or old
category.   
Now the possibility is that a user can selecct 1 or 2
or all three options.

In the query form, I gave the option for a user as a
check box. The piece of html code is as below:

DIVAge group/DIV
DIVYounginput type=checkbox name=
value=/DIV
DIVMiddleinput type=checkbox name=
value=/DIV
DIVOldinput type=checkbox name= value=/DIV

Problem:
I want to capture the user options and create an SQL
statement:

Select age_group from patient_data where age_group =
young and old ; 


I am truly stuck here. Can any one please help me out
to pass this situation. 

Thank you in advance.

Kumar. 




__ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

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



Re: [PHP-DB] Filling Drop-Down Box.

2004-12-25 Thread Mike S.
 Hello All,

 I want to fill drop-down box from mysql table, if any body
 be kind to tell me a sample code :)
 e.g:
 In my application i want to gather subject list from current
 semester-subject table of a student.

 TIA
 --
 Nayyar Ahmad

You know that the HTML code for the drop-down is:
SELECT NAME=SAMPLE
OPTION VALUE=1Whatever 1/OPTION
OPTION VALUE=2Whatever 2/OPTION
/SELECT

Here's some pseudo-code remarks that should help you with your coding:

- whatever.html -
Drop-down: SELECT NAME=sample
?php
   //  connect to your database - if you haven't already
   //  construct a query to pull the records you want, and
   //  in the order you want to display them
   //  execute the query
   //  loop through the results, building an OPTIONwhatever/OPTION
   //  for each element in the drop-down.  You can get creative
   //  here if you need to.  Like:
   //  OPTION VALUE=##whatever/OPTION
   //  where ## is the key field, and whatever is another
   //(descriptive) field in your query
   //  close your database connection (or later, if needed)
?/SELECT

Try to fill in the actual code yourself.
If you get stuck, you can look at:
http://www.netmask.com/php-db/sample-dropdown.html

Good luck!

:Mike S.
:Austin TX USA

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



[PHP-DB] what is wrong with my code.. please help

2004-12-25 Thread S Kumar
Dear group, 
 I am trying to query my db and print the results. 

when i execute my script, i am not getting any result
except a blank page. can any one please help me what
is going wrong with my script. 

Script:

$conn = pg_connect(user = $user dbname = $dbname host
= $host password = $pass);
if (!$conn)
{
echo('could not establish connection with
database br');
exit;
}
$sql = select * from experiment;
$sth = pg_exec($connect,$sql)
if (! $sth){
die(Can't execute query.pg_errormessage());
}

for($i = 0,$j = pg_numrows($sth);$i  $j;$i++){
$ar = pg_fetch_row($sth,$i);
foreach($ar as $col){
print $col ;
}
print \n;
}

?

thank you in advance

kumar

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP-DB] data is not entering in created database

2004-12-24 Thread Mike S.
 hallo ,

 i have wriiten simple php script , below.
 created databse dollar1_allinfo with table 'totalinfo'

 but on clicking submit button ,

 information entered is not entering in database.

 also,  echo statements are also not displaying after submit

 ?php
 if ($submit)
 {
 $db = mysql_connect(localhost,root);
 mysql_select_db(dollar1_allinfo,$db);
 mysql_query(INSERT INTO totalinfo (username,password,) VALUES
 ('$loginusername','$loginpassword'));
  echo 'thank you';
  echo 'So Hurry Up';
   }
?

 thank you.

Because your query and echoes are within an if block, I'd say that
$submit is evaluating to FALSE, and thus not executing the query and
echoes.

Add (before the if statement):

   echo Submit = $submit;

Make sure that $submit is evaluating to TRUE.


To All Beginning Programmers (Newbies), or just people who want to
easily debug their code:
Try adding debugging statements to help you find problems.  A few echoes
or prints in selected locations will help identify the issue.  Make sure
your variables are evaluating to values that you think they should be.

If you want to keep the debugging statements in your code and just
activate them when you need to see them, do something like:
// near the top of your code
$debug=TRUE;
// and anywehere in your code
if ($debug) {
   echo DEBUG: Submit = $submitBR\n;
}
// or whatever echo might help you nail down the problem.  Put as many of
these in your code and you can turm them ON and OFF very easily, by
changing one line of code.

OR for even quicker debugging, replace $debug=TRUE; with
   $debug=$_GET['debug'];
and then you can turn it on in by adding ?debug=TRUE at the end of the
URL. Example:  http://www.php.net/path/my.html?debug=TRUE
or:  http://www.php.net/path/my.html?debug=1
**DISCLAIMER**  Using the URL method is NOT a secure way to do this!!! 
And I'm sure there's plenty of folks groaning out there because it is a
BIG security hole.  You really would want to do this on a development
machine and network, and remove the debug code for production.  That
really should go without saying.

Good luck.

:Mike S.
:Austin TX USA

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



Re: [PHP-DB] PHP on an Windows intranet with MSOffice-like templates

2004-11-17 Thread Ricardo J. S. Oliveira







You're welcome...

Best regards,
Ricardo Oliveira


---Original Message---


From: [EMAIL PROTECTED]
Date: 11/17/04 00:02:48
To: Ricardo J. S. Oliveira
Subject: Re: [PHP-DB] PHP on an Windows intranet with MSOffice-like templates

You're my hero.

Thanks!

-P


Quoting "Ricardo J. S. Oliveira" [EMAIL PROTECTED]:

Why don't you try to define some templates but instead of using Office
 documents, use PDF ones, try using fpdf, a free php class to generate pdf's

 Regards,
 Ricardo Oliveira

 ---Original Message---

 From: [EMAIL PROTECTED]
 Date: 11/16/04 23:24:24
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] PHP on an Windows intranet with MSOffice-like templates

 I don't even know if this is possible, or if I'll have to go the route of
 NET
 development to get this sort of functionality (I'm sure it's possible if I
 jump
 through enough hoops).

 But here's what I'm trying to accomplish...
 - users are all on a local intranet with access to a shared drive (no prob)
 - users navigate a PHP-MySQL application to select records from a database
 (no
 prob)
 - users are able to click a link which will launch some sort of document
 (they
 have Office, but if something like PDF is available on a Windows platform,
 great) where a document template is fetched and updated with information
 from
 the selected record.(This is the part I don't understand how to do).

 An example... user wants to be able to print one of a variety of letters to
 physically mail to a customer, customized with the customer's account info.
 (You know:Dear [first name] [last name], ... Your account [account_id] ...
 is
 30 days past due... etc )

 This way, management can update the template and not have me re-work the
 code to
 have it work...

 Is such a thing possible on a windows PHP platform?Can someone point me to
 somewhere I can learn more about it?

 Thanks much,
 -P

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















[PHP-DB] -14 Days Ago

2004-10-08 Thread Cole S. Ashcraft
I am trying to see whether a data in an array pulled from a MySQL DB 
(YEARMONTHDATE) is older than 14 days ago. I am trying to do this in 
PHP. My code looks like:

if($array['due'] = $today - 14)
{
echo h5Assignment In Void:/h5brh4Assignments in the void are 
read-only;
require('footer.php');
exit;
}.

I am having problems with the math. How do I do a date subtraction 
without ending up with something like 20040994 (not a valid date)?

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


Re: [PHP-DB] -14 Days Ago

2004-10-08 Thread Cole S. Ashcraft
I needto do it in PHP, though.
Cole
Wendell Frohwein wrote:
You can trying using the MySQL DATE_ADD() , DATE_SUB , and NOW()
functions.
-wendell frohwein
-Original Message-
From: Cole S. Ashcraft [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 08, 2004 11:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] -14 Days Ago

I am trying to see whether a data in an array pulled from a MySQL DB 
(YEARMONTHDATE) is older than 14 days ago. I am trying to do this in 
PHP. My code looks like:

if($array['due'] = $today - 14)
{
echo h5Assignment In Void:/h5brh4Assignments in the void are 
read-only;
require('footer.php');
exit;
}.

I am having problems with the math. How do I do a date subtraction 
without ending up with something like 20040994 (not a valid date)?

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


Re: [PHP-DB] -14 Days Ago

2004-10-08 Thread Cole S. Ashcraft
That would probably work, and its not too hard to do a rows returned check.
Richard Hutchins wrote:
Cole,
I don't know the full context of how you need to do your date math. However,
what if, instead of selecting a bunch of data and putting it in an array in
PHP then checking to see if its older than 14 days you wrote your query to
pull only those records that are older than 14 days?
Something like (assuming MySQL):
mysql select contentID, printDate from docmeta where TO_DAYS(NOW()) -
TO_DAYS(printDate)  14;
The above query subtracts a column's value from today's date. If the
difference is greater than 14, it get pulled into the query. If you only
wanted records newer than 14 days, you would just flip the comparison
operator like so:
mysql select contentID, printDate from docmeta where TO_DAYS(NOW()) -
TO_DAYS(printDate)  14;
(I hope I got that right)
Anyway, from there, you could do whatever you need to do with the result set
programmatically inside of your PHP script. My hunch is that it might be a
little faster to do the date math in MySQL (or your db of choice) and just
work with the exact result set you want inside your script.
Hope this helps.
Rich


-Original Message-
From: Cole S. Ashcraft [mailto:[EMAIL PROTECTED]
Sent: Friday, October 08, 2004 2:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] -14 Days Ago
I am trying to see whether a data in an array pulled from a MySQL DB 
(YEARMONTHDATE) is older than 14 days ago. I am trying to do this in 
PHP. My code looks like:

if($array['due'] = $today - 14)
{
echo h5Assignment In Void:/h5brh4Assignments in the void are 
read-only;
require('footer.php');
exit;
}.

I am having problems with the math. How do I do a date subtraction 
without ending up with something like 20040994 (not a valid date)?

Thanks,
Cole
--
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] Error with addition of second

2004-09-18 Thread Cole S. Ashcraft
It doesn't like the };
On Sat, 2004-09-18 at 19:04, Mark wrote:
 --- [EMAIL PROTECTED] wrote:
 
  Dear friends,
  
  With 4 radio buttons and php snippet, it gives desired output,
  however when I 
  add second question in the html form and variable for the same like
  $variable =$_POST['q'] in Php snippet 
  it gives me error.
  
  I have pasted php code when it works and when it gives error.
 
 Did you read the error? It's pretty explicit.
  
  Any guidance, please.
  
 
 --
  Error
 
 --
  ---
  Parse error: parse error, unexpected ',' in
  C:\HOME\doctorbush\quiz.php on 
  line 10
 
 --
  -
  php snnipet, code which it works with Q-1
 
 ---
  ?php
  
  $variable = $_POST['R']  ; 
  
   if ($variable == 3) {
  
echo   Score 1;
  
}
else {
echo  Score 0;
  
};
  ?
  --
  php snippet when it gives error with addition of second question
 
 
  
  
  ?php
  
  $variable = $_POST['R']  ; 
  $secondvar = $_POST['q']  ; 
  
  
  
   if ($variable == 3, $secondvar== 4) {
 
 This is not a valid PHP statement. Do you mean AND, or OR? the error
 said line 10, right? This must be line 10. There is only one comma in
 it.
 
 Depending on what you mean, either use:
 
 1- if ($variable == 3 AND $secondvar== 4) {
 
 or
 
 2 if ($variable == 3 OR $secondvar== 4) {
 
 
  
  
  
echo   Score 1;
  
}
else {
echo  Score 0;
  
   ?
  --
  Html form code
 
 ---
  html
  
  head
title/title
  /head
  
  body
  form method=POST action=quiz.php
  
  
   Q-1)Law of diminished return is ;br
  input type=radio value=4 checked name=R 
  Medical concept  BR
  input type=radio value=3 checked name=R 
  Economic   BR
  input type=radio value=2 checked name=R  Agriculture   
   BR
  input type=radio value=1 checked name=R  Computers 
 BR
  p
 
 Also, you shouldn't have all of the radio buttons associated with the
 same variable checked. In fact, if this is a quiz, none should be
 checked.
 
 And this last question doesn't even make sense :-)
 
  
  Q-2)Once there is inflation ;br
  input type=radio value=4 checked name=q 
  Government has to print extra currency  BR
  input type=radio value=3 checked name=q 
  Inflation is good for economy BR
  input type=radio value=2 checked name=q  
  Inflation is diastrous for economyBR
  input type=radio value=1 checked name=q  
  Inflation is not of much concern BR
  
  
  
  INPUT TYPE=SUBMIT NAME=submit VALUE=See Score
  /form/body
  
  /html
  
 
 
 =
 Mark Weinstock
 [EMAIL PROTECTED]
 ***
 You can't demand something as a right unless you are willing to fight to death to 
 defend everyone else's right to the same thing.
 ***
 
 
   
 __
 Do you Yahoo!?
 Y! Messenger - Communicate in real time. Download now. 
 http://messenger.yahoo.com

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



[PHP-DB] select query across multiple tables

2004-08-26 Thread Cole S. Ashcraft
I'm trying to pull all the records from the table class where classID is 
not equal to the value of classID in the table assignment.

Currently, I have 'select class.classID, class.classDesc from class, 
assignment where assignment.classID = class.classID and 
assignment.assignmentID=$assidn'. $assidn is value of 
assignment.assignmentID.

When I do this query, I am missing a good chunk of records. What am I 
doing wrong?

Cole
--
This message has been scanned for viruses and
dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed
to be clean.
Please report any deviance from this condition immediately to the AFN
Administrator at [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] select query across multiple tables

2004-08-26 Thread Cole S. Ashcraft
Thanks!

It works

Cole

On Thu, 2004-08-26 at 16:45, [EMAIL PROTECTED] wrote:
  I'm trying to pull all the records from the table class where classID is
  not equal to the value of classID in the table assignment.
 
  Currently, I have 'select class.classID, class.classDesc from class,
  assignment where assignment.classID = class.classID and
  assignment.assignmentID=$assidn'. $assidn is value of
  assignment.assignmentID.
 
  When I do this query, I am missing a good chunk of records. What am I
  doing wrong?
 
 You're only getting the rows that are less then or equal to class.classID,
 i think you want  or not equal to.
 HTH
 Jeff
 
 
 
 
 
 
 
 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed
to be clean.
Please report any deviance from this condition immediately to the AFN
Administrator at [EMAIL PROTECTED]

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



[PHP-DB] Bogus List Messages

2004-07-19 Thread Cole S. Ashcraft
Are the messages with the subject line IMPORTANT: Please Verify Your 
Message bogus? They do not come from the ezmlm mailer at lists.php.net.

They do not have the [PHP-DB] prefix. Have the owners of the list 
requested this?

Cole
--
This message has been scanned for viruses and
dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed
to be clean.
Please report any deviance from this condition immediately to the AFN
Administrator at [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Not Like

2004-07-18 Thread Cole S. Ashcraft
I am trying to figure out how to display something where the condition 
is not like im a MySQL query. The query is

select * from class where classID like '_00'order by classID;
How would I make the like into a not like (aka negating it. The ! does 
not work)? I couldn't find anything in the MySQL manual.

Thanks,
Cole
--
This message has been scanned for viruses and
dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed
to be clean.
Please report any deviance from this condition immediately to the AFN
Administrator at [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Mysql 5.0 Redhat

2004-07-02 Thread Cole S. Ashcraft
You need to compile PHP with MySQL support. There is a php-mysql.rpm 
package, but I'm not sure if it will work with MySQL 5. You might just 
have to recompile PHP (but probably not).

Cole
Iain Wiseman wrote:
Cole S. Ashcraft wrote:
They are at http://dev.mysql.com/downloads/mysql/5.0.html.
Iain Wiseman wrote:
Hi,
Sure this has been asked but I want to use the new mysql 5.0 rather 
than downgrade and I want to use a package installer so I can take 
it off if it does not work.

Are there rpms for Redhat 9.0 to enable PHP to work with MySql 5.0
I am assumming (and maybe incorrectly) that this is my problem for
Fatal error: Call to undefined function: mysql_connect() in 
/var/www/html/guestbook/guest.config.php on line 14

Thanks
Iain

I have dowloaded and installed
MySQL-shared-5.0.0-0
MySQL-server-5.0.0-0
MySQL-client-5.0.0-0
MySQL-devel-5.0.0-0
However I still get the error. I seems pretty common when I put it 
into google. There used to be a package call 
php-mysql-4.2.2-17.i386.rpm that seemed to do the neccesaries for PHP. 
Added a mysql.ini and put a library mysql.so into the php extension 
directory.

What does this for 5.0? And what steps do I need to do to analyze the 
error. Obviously I can connect to my database from the command prompt.

Thanks
Iain

--
This message has been scanned for viruses and
dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed
to be clean.
Please report any deviance from this condition immediately to the AFN
Administrator at [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] How to take Backup ?

2004-07-01 Thread Cole S. Ashcraft
Try the mysqldump command
zareef ahmed wrote:
Hi,
 If you have phpmyadmin on your system you can export
all your data in sql format which can be restore again
by running that sql script. make sure to check
complete insert checkbox at time of export operations.
Revert Back with any comment or problem.
Zareef Ahmed
--- Rinku [EMAIL PROTECTED] wrote:
 

I want to take backup for Mysql database.
Can any of you tell me how to take Backup and how to
Restore it ?
Rinku
__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 
   


=
Zareef Ahmed :: A PHP Developer in Delhi(India).
Homepage :: http://www.zasaifi.com
		
__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

 


--
This message has been scanned for viruses and
dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed
to be clean.
Please report any deviance from this condition immediately to the AFN
Administrator at [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Call to undefined function mysql_connect()

2004-06-30 Thread Cole S. Ashcraft
Rinku's Response: I may be missing something, but hows that related?
The phpinfo() function generates a page that shows what is installed. 
See if the configure string has --with-mysql or something like it. There 
also should be a section called mysql. Take a look at 
http://ashcraftfamily.net/info.php.

Leandro de Oliveira wrote:
I don´t know how to see if mysq is enabled
but i tested this, it is like i have no php
file: form.php
html
head
titleForms/title
/head
body
?php
if ($text != )
echo You wrote \$text\ brbr;
?
form method=POST action=form.php
input type=text name=text value= size=10
br
input type=submit name=sub value=Send it!
/form
?php
echo $HTTP_USER_AGENT;
?
/body
/html
submit dont works, echo $HTTP_USER_AGENT too, but phpinfo() worked!
what is going on?

-
Crie seu Yahoo! Mail, agora com 100MB de espaço, anti-spam e antivírus grátis!
 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Call to undefined function mysql_connect()

2004-06-27 Thread Cole S. Ashcraft
Create a page called phpinfo.php. In it put ?php phpinfo() ?. Search 
for MySQL. You probably don't have MySQL support in your installation.

Cole
Leandro de Oliveira wrote:
Hi!
I want test MySQL with PHP, for that I wrote this:
html
headtitleTest MySQL/title/head
body
?php
$con = mysql_connect(localhost, lehphyro, );
$success = mysql_select_db(mysql, $conexao);
if ($success  0)
echo Success!!;
else {
echo Failure!!;
echo mysql_error();
}
?
/body
/html
But i received Call to undefined function mysql_connect() on line 5
Can anyone help me?
Thanks!

-
Crie seu Yahoo! Mail, agora com 100MB de espaço, anti-spam e antivírus grátis!
 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] SSL with MySQL 4.0

2004-06-24 Thread Cole S. Ashcraft
Is there such thing as SSL connections to MySQL?
Edgar Hassler wrote:
Does PHP support SSL connections to MySQL?  If no, does anyone have an idea
how to make an SSL conncetion to MySQL using PHP?
Thanks,
   Edgar Hassler
 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: problem....

2004-06-23 Thread Cole S. Ashcraft
Kim,
Won't redefining the variable destroy the MySQL Resource, resulting in a 
resource invalid error, like he has?

$pic = mysql_query($sql,$connection); //Defines variable
$pic //Redefining variable, dumps old contents = //calling on an invalid MySQL Resource, because it doesn't exist mysql_fetch_array($pic); 

My comments are in green.
Cole
Kim Steinhaug wrote:
Well, your query looked confusing to me, but break it up like this
First :
   select
Then, name your coloumns, seperate with commas, or use wildcard for all
   *
Define from what table you need to select
   FROM database_table
Add some select statements with WHERE
   WHERE
and the statements itself
   1=1
What did I just write now? Looking at your example I guess :
1. you need the coloumns : Rune, username
2. your table : RuneRunner
3. your select criteria : UserID=3
I would then write your SQL query as this :
$sql = SELECT Rune, username FROM RuneRunner WHERE UserID=3;
Then you could do your code,
$pic = mysql_query($sql,$connection);
$pic = mysql_fetch_array($pic);
You would also want to add a database abstraction layer, as for debugging
purposes this will make your life much easier.
Your original code looks to correct if you rewrite it abit, like this :
SELECT RuneRunner_1.Rune, RuneRunner_1.username FROM RuneRunner RuneRunner_1
WHERE (RuneRunner_1.User_ID=3);
Not tested but it should work fine. On the other hand, the referencename
after the
table name should be a short one to make the statement much easier to read,
somthing like :
SELECT rr.Rune, rr.username FROM RuneRunner rr WHERE (rr.User_ID=3);
Then again, since you only have one table in your statement there is no need
for the reference name,
and since your WHERE clause is a single statement there is no need for the
paranthese either.
So you are still back to :
SELECT Rune, username FROM RuneRunner WHERE User_ID=3;
--
--
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--
Water_foul [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

why doesn't this work:
$pic=mysql_query('SELECT Rune, username FROM RuneRunner
RuneRunner_1 WHERE (User_ID = 3)',$connection);
$pic=mysql_fetch_array($pic);
   

 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] problem....

2004-06-22 Thread Cole S. Ashcraft
Just from looking at it, it seems to be because you are redefining a
variable, which destroys it, then calling for a mysql resource that has
been destroyed. What is the error?

I can't gaurantee that that is what is happening.

Cole

 why doesn't this work:
 $pic=mysql_query('SELECT Rune, username FROM RuneRunner
 RuneRunner_1 WHERE (User_ID = 3)',$connection);
 $pic=mysql_fetch_array($pic);

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


 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is believed to be clean.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.

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



Re: [PHP-DB] problem....

2004-06-22 Thread Cole S. Ashcraft
The error he is getting means that his MySQL resource (in this case the
results of the query) does not exist. Try
$pic1=mysql_fetch_array($pic);
Also, can you give the exact text of the error (line number and all) and line numbers for the entire passage? 

Cole
Shahmat Bin Dahlan wrote:
Your SQL statement:
'SELECT Rune, username FROM RuneRunner
RuneRunner_1 WHERE (User_ID = 3)'
What is RuneRunner and RuneRunner_1? Are these two different tables.
If it is, you might want to separate them with a comma.
Why not try getting rid of the brackets surrounding User_ID=3? And
also wrap single quotes around the digit 3.
- Original Message -
From: water_foul [EMAIL PROTECTED]
Date: Wednesday, June 23, 2004 8:58 am
Subject: Re: [PHP-DB] problem
 

I checked em all they were right
Daniel Clark [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
   

Sounds like it doesn't like your SQL statement.  Perhaps a field 
 

or table
   

name is incorrect?
 

Warning: mysql_fetch_array(): supplied argument is not a valid 
   

MySQL  result
   

resource in ...
Daniel Clark [EMAIL PROTECTED] wrote in message
   

news:[EMAIL PROTECTED]
   

What error are you getting?
 

why doesn't this work:
$pic=mysql_query('SELECT Rune, username FROM 
   

RuneRunner   RuneRunner_1 WHERE (User_ID = 3)',$connection);
   

$pic=mysql_fetch_array($pic);
   

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

 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] problem....

2004-06-22 Thread Cole S. Ashcraft
I need the exact error message. Copy Paste it from the browser. I also 
need line numbers.

Cole
water_foul wrote:
i fixed those things and it didn't fix it :( :( :( :( :( :( :( :( :( is
there a icq chatroom for php?)
Shahmat Bin Dahlan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

Your SQL statement:
'SELECT Rune, username FROM RuneRunner
RuneRunner_1 WHERE (User_ID = 3)'
What is RuneRunner and RuneRunner_1? Are these two different tables.
If it is, you might want to separate them with a comma.
Why not try getting rid of the brackets surrounding User_ID=3? And
also wrap single quotes around the digit 3.
- Original Message -
From: water_foul [EMAIL PROTECTED]
Date: Wednesday, June 23, 2004 8:58 am
Subject: Re: [PHP-DB] problem
   

I checked em all they were right
Daniel Clark [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

Sounds like it doesn't like your SQL statement.  Perhaps a field
   

or table
 

name is incorrect?
   

Warning: mysql_fetch_array(): supplied argument is not a valid
 

MySQL  result
 

resource in ...
Daniel Clark [EMAIL PROTECTED] wrote in message
 

news:[EMAIL PROTECTED]
 

What error are you getting?
   

why doesn't this work:
$pic=mysql_query('SELECT Rune, username FROM
 

RuneRunner   RuneRunner_1 WHERE (User_ID = 3)',$connection);
 

$pic=mysql_fetch_array($pic);
 

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

 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] content managment systems

2004-06-20 Thread Cole S. Ashcraft
I really like Mambo Open Source- mamboserver.com or mosforge.net. They 
are about (hopefully ;)) going to release version 4.6 real soon. 4.5 is 
great too, but 4.6 promises to be way better,

Cole
Kim Steinhaug wrote:
I love that site, really the best way to get familiar with the common
systems out there.
--
--
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--
Kenny [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

Hi lisi,
Have a look at www.opensourcecms.com
They have all the popular CMS systems loaded on a server in one place so
you can see them in action, once you find the one you like you can d/l
it from there site as well
Kenny
-Original Message-
From: Lisi [mailto:[EMAIL PROTECTED]
Sent: 16 June 2004 10:11
To: PHP-DB
Subject: [PHP-DB] content managment systems
I am looking for open source CMSs that:
1) use PHP/Mysql
2) are relatively easy to install, for someone familiar with both PHP
and MySQL
3) also easily allow you to change the layout/template from the default
For instance, if I want to hire a graphic designer to create a static
page
for me with a unique design for my site, I want to be able to create a
template file from that (possibly one template for the home page and a
second one for inside pages) and then plug in a CMS into that layout (or
plug the template into a CMS) so the client can then make any changes to
any pages without having to go through me.
I've heard PHP-Nuke is a very good portal system - would it work for
this?
Any other recommendations? The CMS must be open source, the budget is
very
limited right now.
Thanks!
-Lisi
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   

 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: SV: [PHP-DB] Drawing table by while

2004-05-26 Thread Mike S.
Or like this (to be a little more complete, with comments):

// initialize counter
$count=0;

// start the table and the first row
echo tabletr;

// loop through fetch results
while ($myrow = mysql_fetch_array($sql))
{
   //  if we've output 5 columns...
   if ($count==5) {
  //  end the current row, start another
  echo /trtr;
  //  and reset our counter
  $count=0;
   }
   // output the next cell in this row
   echo td.$myrow[0]./td;
   // and increment the counter
   $count++;
}
// end the row and the table
echo '/tr/table';


I've used this type of code before, but have not checked the specific code
above for spelling or other typographic errors.

The example code posted earlier (see below) had a small error in that the
counter was incremented twice if it was the first column, therefore only
printing 4 columns.


:Mike S.
:Austin TX USA



 Something like this:

 echo 'table';
 $count=1;
 while ($myrow = mysql_fetch_array($sql))
 {
 If ($count==5) {
   echo /tr;
   $count=1;
 }
 If ($count==1) echo tr;
 $count++;
 echo $myrow[0];
 }
 echo '/table';

 Hth Henrik Hornemann

 -Oprindelig meddelelse-
 Fra: nabil [mailto:[EMAIL PROTECTED]
 Sendt: 26. maj 2004 14:28
 Til: [EMAIL PROTECTED]
 Emne: [PHP-DB] Drawing table by while


 Hiya,

 How can i draw a new tr AFTER FIVE  td in the following loop

 (i want to echo the records in 5 columns width tables whatever the
 number of records will be fetched)

 ..
 echo 'table';

 while ($myrow = mysql_fetch_array($sql))
 {
 echo $myrow[0];
 }
 echo '/table';


 --
 |   x |   y |z  |   o |
 --
 |f|q|  h|   hj |
 --
 .
 .
 .

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



Re: [PHP-DB] question on select

2004-05-12 Thread Tony S . Wu
sounds like a job for JavaScript.

Tony S. Wu
[EMAIL PROTECTED]
Look into the right places, you can find some good offerings.
http://homepage.mac.com/tonyswu/stw- The perfect business.
http://homepage.mac.com/tonyswu/tonyswu- My web page.
 
---



On May 12, 2004, at 7:02 AM, hengameh wrote:



Hello,

I am very new to php and mysql so please be patient with me. I don't  
even
know if I am using the right listing, but I hope someone can help me!



I need to create a select and the possible options are from my mysql
database ( so far so good, I was able to find code to do that).
Now I need to use the user selected option to drive the options of me  
next
select.  I need to know how to capture what user selected and how to  
pass
that around? I have used onchange attribute of the select to  
capture the
selected line but now how can I pass that to other php scripts?  ( I  
need to
get the name of the country so that I can show a list of possible
state/province. I setting the value of the newcountry input to the
selected country but when I do echo $newcountry in quicksearch.php,  
its
blank!!)

Please help!!



Thanks so much



Here is what I have so far:



Quicksearch.php file has the following code

br

table class='form'

  tr

thSteps 1-4/th

  /tr



  trtd

form name=fcountry method=post

  ?php  require(country_build.php);?

  input type=text name=newcountry value=



  /form



/td/tr

/table

!-- quicksearch.php   end --



script language=JavaScript

!--

function changeMenu()

  {

  document.fcountry.newcountry.value =
document.fcountry.country.options[document.fcountry.country.selectedInd 
ex].v
alue;

 }

--

/script



Countrty_buil.php has the following



?php

require_once(util.php);



echo SELECT name=\country\ class=\input\   
onchange=\changeMenu()\;

//

// initialize or capture the country variable

$country = !isset($_REQUEST['country'])? Select a country:
$_REQUEST['country'];
$countrySQL = !isset($_REQUEST['country'])? *: $_REQUEST['country'];

echo option value='$countrySQL' SELECTED$country/option;

$query = SELECT country FROM . TABLECOUNTRY .  ORDER BY country  
ASC;

// pconnect, select and query

if ($link_identifier = mysql_pconnect(DBSERVERHOST, DBUSERNAME,  
DBPASSWORD))
{

  if ( mysql_select_db(DBNAME, $link_identifier)) {

// run the query

 $queryResultHandle = mysql_query($query, $link_identifier) or  
die(
mysql_error() );

 $ctrRows = mysql_num_rows($queryResultHandle); // row counter

// if data exists then $rows will be 1 or greater

if( $ctrRows == 0 ) {

  echooption value='*'No data  
found/option/select;

}else{

  // build the select list

  while($row = mysql_fetch_object($queryResultHandle))  
{ //
grab a row

echo option
value=\$row-country\$row-country/option;
  }

  echo /SELECTbrbr;



}

  }else{ // select

echo mysql_error();

  }

}else{ //pconnect

  echo mysql_error();

}

?











[PHP-DB] PostgreSQL lib and character case

2004-04-28 Thread Tumurbaatar S.
I use pg_fetch_array() to get a record content. But it seems that
to access elements of  the returned associative array, I should
use lowercase field names. Is there any way to use case-insensitive
field names?

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



[PHP-DB] Anybody using PostgreSQL?

2004-04-14 Thread Tumurbaatar S.
In PHP5 manual, it says that
when using large objects functions
of PostgreSQL, a program should
manually begin/end transaction.
But what about other query/exec functions?
Do I need to control transactions or every function
call implicitly wrapped with transaction block?
What if a command consists of several SQL
statements or a command calls a user-defined
function which also executes several statements
within its body?

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



[PHP-DB] Re: postgresql

2004-04-14 Thread Jason S Motes
if i remember correctly you have to do this

  su
  su postgres
  createuser your-user-id


Adam Williams wrote:
Hi, I know this isn't PHP related but I have a quick question about 
postgresql.  I come from a mysql enviroment so I'm a little clueless, even 
after reading the postgresql docs.  

I am moving a postgresql database from one server to another.  As the user 
that owns the database, lculber, I ran pg_dump sroom1  sroom1.database 
but on the server I'm moving the database to, I can't figure out how to 
get into psql to create the user lculber so I can do psql sroom1  
sroom1.database

so how can I create the users lculber in postgresql.  I can't even connect 
to psql.  any advice? :)  below is my command.  I'm not trying to database 
root, I just want to get the psql prompt so I can create the user lculber.

[EMAIL PROTECTED] root]# psql -U root
psql: FATAL:  Database root does not exist in the system catalog.
[EMAIL PROTECTED] root]# createuser lculber
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
psql: FATAL:  user root does not exist
createuser: creation of user lculber failed
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Accessing MS SQL from Linux

2004-03-12 Thread S K Rana

My domain is hosting through a hosting company on Linux with PHP 4.3.4. 
Hosting company is not open to re-compile PHP for using FreeTDS or
any other application.

If I can not use FreeTDS, what other options do I have? 

a)  Can Pear be used? It is 4.3.4. I tried

 ?php required_once(DB.php)  ?

   but got error.

b) Can ADODB be used without re-compiling
PHP?

Any other option?

Thanks

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



[PHP-DB] Re: Form doesnt write to database

2004-02-07 Thread Mike S.
 Dear friends,
 Form doesn't write to mysql database. I have pasted code of mysal
 table structure,html form and php script. Any comments, please.

 // create the SQL statement
 $sql = INSERT INTO testtable values ('{'', $_POST['testField']}','
 {'', $_POST['testFielda']}','{'', $_POST['testFieldb']}','{'',
 $_POST['testFieldd']}','
 {'', $_POST['testFieldc']}','{'', $_POST['testFielde']}');

I tried your code on my system and got an error of 'incorrect number of
parameters'.  That's when I realized you need NULL as the first
parameter in your values.  I didn't see in the MySQL docs where it
requires the NULL, but in one of the examples, it was there.

Insert NULL as the first parameter and it should work.

I also got a parse error because of the '{' and '}' symbols around your
$_POST variables.  I changed it to:

$sql = INSERT INTO testtable values ( NULL, '.$_POST['testField'].',
'.$_POST['testFielda'].', '.$_POST['testFieldb'].',
'.$_POST['testFieldd'].', '.$_POST['testFieldc'].',
'.$_POST['testFielde'].' );

and got a working solution.

Suggestion: You could try using the mysql_errno() and mysql_error()
functions.  Print them out after your failed statement and you'll see
why the mysql call failed.

Example:
  print Error # .mysql_errno(). - .mysql_error().BR\n;

will print the error number and message.  This will give you some idea
of what went wrong.

Good coding practice dictates that you check for an error condition
after mysql calls [using mysql_errno()] and handle any errors
appropriately.

If you don't already have it, you'll want a list of the error codes and
their meanings.  You can find it in the mysql source code
Docs/mysqld_error.txt file.  If you can't find that right now, copy this
web page I whipped up right now:

   http://web.netmask.com/2004/02/mysql-error-codes.html

or, if you prefer a flat, text file:

   http://web.netmask.com/2004/02/mysql-error-codes.txt



Good luck!

:Mike S.
:Austin TX


---
Sent: February 7, 2004, 6:48 pm

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



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

2004-02-05 Thread Mike S.
Actually, there is a way to do this with PHP.  It may not be the best
method, but it is possible.  You could do it with one single source file,
or multiple.

With a single source file you could do something like this:
The first time through would display the first popup with valid choices. 
Form action would post the results of the popup to the same page.  Now you
have a variable with a value from the first popup.  You can then display
your second popup choices based on the first.  And so on for any remaining
popups.

With multiple source files:
The first page displays the first popup. Form action would post the
results to the next page.  As with the first method, you now have a
variable with a value from the first popup.  Display your second popup
choices based on the first.  And so on...

Pro:  You don't need to learn Javascript.
Con:  The web page is redrawn for each new popup selection - not seamless
like a pure Javascript solution may be.

Using multiple source files may help you keep load time down as well as
make it easier to maintain.  It's a matter of personal choice, I think.

If you don't program Javascript, this is one method you may consider -
though I would encourage anyone writing web pages to learn Javascript. It
can be a real lifesaver!  :-)

With either method (PHP or Javascript), you'll probably want to code in
some way for the user to go back and re-select the first popup, i.e. start
over.

Sorry, I don't have sample code.  I haven't had a need for this type of
popups yet, but I have a project coming up soon that probably will.  If I
get a chance to code up a sample, I'll make it available.

Good luck.

:Mike S.
:Austin TX

On Thu February 5 2004 7:33pm, Micah Stevens wrote:

 Javascript is client side programming, PHP is server side and unable to
 control actions and make decisions on what's happening in the browser
 except  in a 'third person' manner.

 Simply put, you can't do this with PHP.

 On Thu February 5 2004 5:21 pm, alb_shop wrote:
 Hello all,

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

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

 Ie : Countries -- states

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

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

 Thank you


---
Sent: February 6, 2004, 12:09 am

-- 
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 V i s h a l Kashyap @ [Sai Hertz And Control Systems]
Dear Thomas J. Rudd ,

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

This sucks,  I have tried to unsubscribed 10 times with out any success

--
Regards,
Vishal Kashyap
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
I Know you believe my words so logon to Jabber.org
and add [EMAIL PROTECTED] to your roster.
~*~*~*~*~*~*~*~*
I am usually called by the name Vishal Kashyap
but my Girl friend believes my name should be
Vishal CASH UP.This is because others love my
nature and my Girl friend loves my CASH.
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] transaction locking

2003-12-05 Thread Opec Kemp [ q u a s a r z ]
Hi, 

Aleks Kalynovych wrote:
 I have a couple forms that generate a unique ID based on taking
 the highest
 number in the ID column adding 1 to its value. The problem is that I
 dont save that number until the form is submitted. If 2 or more
 persons fill out
 the form at the same time they all get the same
 ID number.  I hope that there are some suggestions on how to
 accomplish this
 with a better method

You really should avoid using this method precisely because of the concurrency issue 
that will invariably happen. If you're using MySQL and your ID field is of type 
AUTO_INCREMENT then you can use MySQL built-in method named: LAST_INSERT_ID() or in 
PHP you can use a function named: mysql_insert_id()

http://www.php.net/mysql_insert_id

For more information visit:
http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html

This is concurrency safe so you shouldn't have this problem in the future.

HTH

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



Re: [PHP-DB] how to deal with this (hack) attack?

2003-11-09 Thread Jordan S. Jones
On top of that, kill phpMyAdmin all together from the server.

How do I update my database architecture?

Using a combination or ssh port forwarding and a local Management Client.

MySQL Front (Win32) - 
http://mysqlfront.venturemedia.de/index.php?act=STf=1t=2s=1a1c5747443deb838a59b393fd11ccc7
CocoaMySQL (OSX) - http://cocoamysql.sourceforge.net/
MySQLCC (Linux) - http://www.mysql.com/products/mysqlcc/index.html

Jordan

Peter Monk wrote:

Merlin wrote:

I am running a medium size php/mysql website. In the last days I 
recieved more and more mysql errors due to url tempering. Now my 
website went down for at least 5 minutes, or more detailed the 
database server mysql 3.x went down. In the apache logs I found 
requests like
connection:close comming from unspecified clients.


Change your mysql username privileges so that logins can only come
from localhost.
Make sure the phpmyadmin conf file isn't visible to outsiders - it has
your mysql database passwords in it.
Consider using deparate usernames/passwords for each mysql database,
so that if a password becomes known, only one database is open to attack.
Make sure you have no usernames/passwords visible in plain text form in
any world-readable files.  Assuming that hackers aren't able to access
known usernames/passwords, they may use brute force attacks to guess
user/password combinations, so make sure your usernames aren't obvious
and that your passwords are strong (ie, not words from a dictionary, 
combination of numbers and letters, uppercase/lowercase, etc.).

My understanding (limited) is that connections closing isn't necessarily
a sign of illicit behaviour, depending on which log file they're in and
the context of their appearance.
If you think you're a target, change all your passwords (in case they
are known) and tighten your security.
Peter.

--
I am nothing but a poor boy. Please Donate..
https://www.paypal.com/xclick/business=list%40racistnames.comitem_name=Jordan+S.+Jones
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] PHP - Mysql privileges

2003-10-26 Thread Karina S
I use php with mysql database. User can insert, update, delete, view table
data from indexed tables.

What kind of privileges do I have to add for a mysql user?
Insert/Update/Delete/Select are enough or I have to add more such as Index
too?

Thanks!

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



[PHP-DB] Re: Using PHP to print using LP on Linux

2003-10-24 Thread Jason S Motes
This is what i use:

  exec (lpr -P $PrinterName $PostscriptFile,$printOut , $printReturn);

Paul Fitz wrote:
 
Hi Guys,
 
I suppose this isn't a database specific question, but it is the only
PHP mailing list I am subscribed to.
 
Trying to trigger a printer in the office hooked up to a Mandrake 8 box
with PHP 4.3 to print a file remotely, using the 'lp' command.
Uses a postscript template to create the text that needs printing.
 
Opens and edits the postscript fine, the printer refuses to work using
the last section of code however.
 
Does anybody have experience using lp with PHP and Linux?
Any help appreciated.
 
Cheers.
 
My Code - 
 
 
$filename = new_user_letter.ps;
$fp = fopen($filename,r);
$fdata = fread($fp, filesize($filename));
fclose($fp);
 
//search and replace all keywords
$fdata = ereg_replace(%%full_name%%,$fullname,$fdata);
$fdata =
ereg_replace(%%street_address%%,$streetaddress,$fdata);
$fdata = ereg_replace(%%town%%,strtoupper($town),$fdata);
$fdata =
ereg_replace(%%state%%,strtoupper($state),$fdata);
$fdata =
ereg_replace(%%postcode%%,strtoupper($postcode),$fdata);
$fdata = ereg_replace(%%date%%,$long_date,$fdata);   
$fdata = ereg_replace(%%username%%,$username,$fdata);
$fdata = ereg_replace(%%email_address%%,$username .
@nor.com.au,$fdata);
$fdata = ereg_replace(%%password%%,$password,$fdata);
$fdata =
ereg_replace(%%primary_dns%%,202.147.135.10,$fdata);
$fdata =
ereg_replace(%%secondary_dns%%,202.147.135.20,$fdata);
$fdata =
ereg_replace(%%pop_location_and_ph_number%%,$location .  -  .
$dial_in_number,$fdata);
$fdata =
ereg_replace(%%domain_name%%,nor.com.au,$fdata);
$fdata =
ereg_replace(%%pop3_server%%,mail.nor.com.au,$fdata);
$fdata =
ereg_replace(%%smtp_server%%,mail.nor.com.au,$fdata);
$fdata =
ereg_replace(%%news_server%%,news.nor.com.au,$fdata);

// Open the lp command for writing and pass the postscript
to it.
//  The loop is to allow multiple copies to be printed,

   for ($copy_loop=0;$copy_loop$num_copies;$copy_loop++){
$fp = popen(/usr/bin/lp -d bw_laser_raw,w);
fputs($fp,$fdata,strlen($fdata));
pclose($fp);
echo .;
}


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


[PHP-DB] PHP-Mysql speed

2003-10-12 Thread Karina S
Hello,

I use PostNuke witm Mysql 4 on my php site and I have about 6000 visitors
pro day. The server is a 2,4Ghz P4 with 1Gb RAM. My problem is that the
server run on 40-45%.

As I know PostNuke use ADO connection. Are the normal Mysql php function
faster than the ADO variant? How big is the difference?
Zend PHP Optimizer can help for me?
How is it possible to handle 40-50,000 visitors?

Thanks!

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



Re: [PHP-DB] Hyperlinking to a new page

2003-10-09 Thread Jordan S. Jones
a href=/location/to/page.php?city_id=2342343City Name/a

Shiloh Madsen wrote:

Ok, I know this should be easy, but im just blanking on how to do it. I have
a webpage where you put in a city name, and it queries a database of all the
cities in the US and brings back all cities matching that name. This part
works just fine. What I want to do now is to create a hyperlink for each
city name which, when clicked on will then call up a second page listing the
details of that city. What I need to do is pass this page the city id (or
any other identifying variable) to the detail page, but I cant for the life
of me remember how to pass the data from one page to another outside of a
form. Any help would be appreciated.
 

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


Re: [PHP-DB] Hyperlinking to a new page

2003-10-09 Thread Jordan S. Jones
Yes..

J

Shiloh Madsen wrote:

actually theres a problem with this, the page returned usually has several
returns in it, so i cant hand code the id in there, will it work to do
page.php?city_id=$city_id?
- Original Message - 
From: Jordan S. Jones [EMAIL PROTECTED]
To: Shiloh Madsen [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, October 09, 2003 4:48 PM
Subject: Re: [PHP-DB] Hyperlinking to a new page

 

a href=/location/to/page.php?city_id=2342343City Name/a

Shiloh Madsen wrote:

   

Ok, I know this should be easy, but im just blanking on how to do it. I
 

have
 

a webpage where you put in a city name, and it queries a database of all
 

the
 

cities in the US and brings back all cities matching that name. This part
works just fine. What I want to do now is to create a hyperlink for each
city name which, when clicked on will then call up a second page listing
 

the
 

details of that city. What I need to do is pass this page the city id (or
any other identifying variable) to the detail page, but I cant for the
 

life
 

of me remember how to pass the data from one page to another outside of a
form. Any help would be appreciated.


 

--
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] how many rows updated

2003-09-11 Thread Jason S Motes
When updating or deleting a table is there anyway to find out how many 
rows where affected using php??

I am using Postgresql 7.2 and php 4.2

using pgsql from the the command line I enter this query
 update teststock set item_num ='something' where item_num ='something';
and it returns
 UPDATE someamount
in php if i use
  $result = pg_exec($conn, $query);
it just returns whether or not the query failed.
I tried this, but it fails because no object was returned from pg_exec()
$data = pg_fetch_object ($result, 0);
foreach ($data as $varName=$value) {
  print $varName nbsp; $value br;
}
Thanks for any help

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


Re: [PHP-DB] how many rows updated

2003-09-11 Thread Jason S Motes
Thanks,
i could not find that function in the book i was using.
sorry for the inconvenience.

John W. Holmes wrote:
Jason S Motes wrote:

When updating or deleting a table is there anyway to find out how many 
rows where affected using php??


I don't even use PG, but it took me 5 seconds to find this:

http://us2.php.net/manual/en/function.pg-affected-rows.php

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


[PHP-DB] Using fopen() for internet URL

2003-06-08 Thread Tony S . Wu
I have an auto-update script to gather some information from other web 
pages to update information in my database.
And i use fopen() to open the URL.
as far as i know, the return result contains image, which i don't need.
so is there anyway to disable loading image when using fopen() with URL?
just want to speed things up a bit :P
thanks.

Tony S. Wu
[EMAIL PROTECTED]
The world doesn't give us hope - it gives us chance.
http://homepage.mac.com/tonyswu/tonyswu- My web page.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Using fopen() for internet URL

2003-06-08 Thread Tony S . Wu
Thanks, i think i got the description mixed up :D

Tony S. Wu
[EMAIL PROTECTED]
The world doesn't give us hope - it gives us chance.
http://homepage.mac.com/tonyswu/tonyswu- My web page.
On Sunday, June 8, 2003, at 04:29 PM, Tony S. Wu wrote:

I have an auto-update script to gather some information from other web 
pages to update information in my database.
And i use fopen() to open the URL.
as far as i know, the return result contains image, which i don't need.
so is there anyway to disable loading image when using fopen() with 
URL?
just want to speed things up a bit :P
thanks.

Tony S. Wu
[EMAIL PROTECTED]
The world doesn't give us hope - it gives us chance.
http://homepage.mac.com/tonyswu/tonyswu- My web page.
--
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] fopen() question and auto update question

2003-06-08 Thread Tony S . Wu
has any of you have any problem with fopen() that it can't open some 
web page?
i am trying to use it to gather information from other web pages, but i 
am having problem with one particular website, macmall.com.
might anyone know what the problem is?
also, if there is no solution to this, i am going to have to abandon 
the idea by using fopen() to gather information.
can anyone suggest an alternative way, which won't cost me too much 
time to get to it?
there will be around 200 data to be updated each time.
thanks a lot.

Tony S. Wu
[EMAIL PROTECTED]
The world doesn't give us hope - it gives us chance.
http://homepage.mac.com/tonyswu/tonyswu- My web page.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Mail() on OS X

2003-06-02 Thread Tony S. Wu
hi all, i am trying to use mail() on Mac OS X 10.2 WITHOUT sendmail.
I have php.ini file in my usr/local/lib directory, with SMTP set to my 
desire smtp server.
But it just doesn't work.
Does anyone here know how to use mail() on OS X?
Thanks a lot.

Tony S. Wu
[EMAIL PROTECTED]
The world doesn't give us hope - it gives us chance.
http://homepage.mac.com/tonyswu/tonyswu- My web page.
Tony S. Wu
[EMAIL PROTECTED]
The world doesn't give us hope - it gives us chance.
http://homepage.mac.com/tonyswu/tonyswu- My web page.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: sending a form feed to a printer

2003-04-02 Thread Jason S Motes
form feeds don't work in html.  It is interpreted as a space.

Arthur Chevalier wrote:
Hello,
 
I am having problems getting the \f (form feed) expression to work.  After a
certain amount of lines print I want to start printing the next line on a
new sheet of paper.  Any ideas of what I could be doing wrong.  Below is a
sample piece of my code.  The bold code is where I am trying to issue the
form feed.
 
while($row = mysql_fetch_array($dbResult))
{
print(TR\n);
print(TD class=\tdborder\A
HREF=\show_single_server.php?server_name=$row[0]\ TARGET=\text_float\
. $row[0] . /TD\n);
print(TD class=\tdborder\. $row[1] . /TD\n);
print(TD class=\tdborder\. $row[2] . /TD\n);
print(TD class=\tdborder\A
HREF=\$PHP_SELF?mid_tier=$row[3]db_rel=0\ TARGET=\text_float\.
$row[3] .  /TD\n);
print(TD class=\tdborder\A
HREF=\$PHP_SELF?db_rel=$row[4]mid_tier=0\ TARGET=\text_float\.
$row[4] .  /TD\n);
 
  $rowdata = $row[5];
  if($rowdata == )
  {
  print(TD class=\tdborder\nbsp;/TD\n);
  }
  else
  {
  print(TD class=\tdborder\. $row[5] .  /TD\n);
  }
  print(TD class=\tdborder\. $row[6] .  /TD\n);
  //print(/TR\n);
  
  if($counter == 20)
{
$counter = 0;
print(/TR\f);
continue;
}
else
{
$counter ++;
print(/TR);
continue;
}
  
}
 



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


Re: [PHP-DB] Catalogue system? there was : Mysql compress text field?

2003-03-06 Thread Patricio Vera S.
Hi!,

Do you have other ideas about how do it?

I thinking do :

1. Save the report in a
MMDD/name-of-report/name-of-report.num-page tree directory
structure.
2. Save in the database the information about the report, and the path
to the page directory.
3. When the user request a report I go to the path and open the
name-of-report.0 (the first page).

Other information :

. There are 2.002 reports montly (so under MMDD directory I have
2002 entries).
. There are 210.000 pages montly.
. The bigest report have 45.217 pages (so under name-of-report
directory I have in the worse case 45.217 entries).
. The smallest report have 16 pages (so under name-of-report directory
I have in the best case 16 entries).
. The average pages report is 7213 by day.

 I have the next dudes (I hope you can help me, or tell me where I can
go) :

. The Linux filesystem support that number of files without degrading
the performance?
. Any knows if exist something similar, or how i can search this under
what concept.
. Any other ideas to implement this?
. For the moment i forgot the idea about zip the files I talk with
my boss and get more disk... :-)

pd.: sorry about the size of the mail i try to be more cleary possible.

Regards,
Patricio.

- Original Message -
From: 1LT John W. Holmes [EMAIL PROTECTED]
To: Patricio Vera S. [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 2:45 PM
Subject: Re: [PHP-DB] Mysql compress text field?


  I have a new project where i need show pages of report on demmand.
 That
  reports are created in the batch process, and the whole file size is
about
 5
  Gb. (thats includes all the reports in a month, I need save about 12
 month).
 
  I think in two alternatives :
 
  1. I save the links in a mysql database, but the files are
compressed
  (in zip format) in several directories, one directorie by day, so when
the
  user request one report, I query the database, go to the path,
decompress
  the file and return to the user.

 Use this method.

  2. I save the reports on the mysql database, so when the user
request
  one report, I query the database and return the report. But if MySql
don't
  compress the text field, that way is not practicable (HDD is limited).

 You'd have to zip the files, then read the data to insert into the table.
 Then, to retrieve, you'd have to select the data out, write it to a file
and
 unzip it before you sent it to the user. (According to your remarks)
Sounds
 like a lot of wasted time to me.

 ---John Holmes...


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

___
Yahoo! Móviles
Personaliza tu móvil con tu logo y melodía favorito 
en http://moviles.yahoo.es

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



[PHP-DB] Mysql compress text field?

2003-03-04 Thread Patricio Vera S.
Hello to all,

I have a new project where i need show pages of report on demmand. That
reports are created in the batch process, and the whole file size is about 5
Gb. (thats includes all the reports in a month, I need save about 12 month).

I think in two alternatives :

1. I save the links in a mysql database, but the files are compressed
(in zip format) in several directories, one directorie by day, so when the
user request one report, I query the database, go to the path, decompress
the file and return to the user.

2. I save the reports on the mysql database, so when the user request
one report, I query the database and return the report. But if MySql don't
compress the text field, that way is not practicable (HDD is limited).

Any ideas or suggestions?

Saludos,
Patricio Vera S.

___
Yahoo! Móviles
Personaliza tu móvil con tu logo y melodía favorito 
en http://moviles.yahoo.es

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



[PHP-DB] Access querys to a csv

2003-02-16 Thread Donald S. Booth
Hi all,
 I am trying to dump an Access db query and form it into a comma delimited
file.
I get the query ok. I can get it into a table with odbc_result_all.
If I print the variable, it shows the first value from the first row...
Any hints on the path I should take?
Thanks,
D



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




[PHP-DB] Secure variable transport (newbie)

2003-01-22 Thread Karina S
Hi,

I have read, that use global variables on php site is not a good idea. I'm
newbie in PHP and maybe a stupid question:
If I make an array and register it in a session and after I use it all of my
pages as $HTTP_SESSION_VARS['variable'] and register_globals is off. In this
case is $HTTP_SESSION_VARS['variable'] a global variable?

What is the best method (most secure method) to use the same array on all
php site? (I want to read the user data, but don't want to read it always
from database. I want to read once and use it on more pages. )

Thanks for your help!




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




[PHP-DB] [NB] Mail() question

2003-01-18 Thread Tony S . Wu
I need to send myself an email in one of my PHP page.
So i wrote the following code:

$result = ini_set(SMTP, smtp.earthlink.net);
	
if ($result)
{
	echo ini_get(SMTP);
	$result = mail([EMAIL PROTECTED], test, test123);
	
	if ($result)
		echo mail sent;
}

It always print mail sent, but I never got the email.
So I was wondering if Mail() request any send mail program to work.
Can anyone tell me?
Thanks.

Tony S. Wu
[EMAIL PROTECTED]


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




Re: [PHP-DB] [NB] Mail() question

2003-01-18 Thread Tony S . Wu
EarthLink is my DSL ISP, so its smtp server is not likely to block my 
mail.
Besides, I can send email with my mail program just fine.
I tried the similar thing on a friend's smtp server where I have access 
to the log, weird thing is I didn't even see PHP trying to access the 
smtp server.
I need to figure out why it's not working fast...
Thanks to your help.

Tony S. Wu
[EMAIL PROTECTED]

It takes a smart man to be stupid. ~Tony


On Saturday, January 18, 2003, at 01:47 PM, Micah Stevens wrote:

The mail() function returns true if it functions, i.e. if you have all
the parameters correct, and that sort of thing. If the SMTP server
rejects the email, you'll still get true returned. I ran into this a
while back. Try and do a manual connection to the SMTP server from your
PHP machine and see if it works that way. It may be failing and you
don't know. If you have access to the mail logs, check those out too.

-Micah


On Sat, 2003-01-18 at 12:48, Tony S.Wu wrote:


I need to send myself an email in one of my PHP page.
So i wrote the following code:

$result = ini_set(SMTP, smtp.earthlink.net);
	
if ($result)
{
	echo ini_get(SMTP);
	$result = mail([EMAIL PROTECTED], test, test123);
	
	if ($result)
		echo mail sent;
}

It always print mail sent, but I never got the email.
So I was wondering if Mail() request any send mail program to work.
Can anyone tell me?
Thanks.

Tony S. Wu


[EMAIL PROTECTED]

--
Raincross Technologies
Development and Consulting Services
http://www.raincross-tech.com





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




Re: [PHP-DB] [NB] Mail() question

2003-01-18 Thread Tony S . Wu
EarthLink is my DSL ISP, so its smtp server is not likely to block my 
mail.
Besides, I can send email with my mail program just fine.
I tried the similar thing on a friend's smtp server where I have access 
to the log, weird thing is I didn't even see PHP trying to access the 
smtp server.
I need to figure out why it's not working fast...
Thanks to your help.

Tony S. Wu
[EMAIL PROTECTED]


On Saturday, January 18, 2003, at 01:47 PM, Micah Stevens wrote:

The mail() function returns true if it functions, i.e. if you have all
the parameters correct, and that sort of thing. If the SMTP server
rejects the email, you'll still get true returned. I ran into this a
while back. Try and do a manual connection to the SMTP server from your
PHP machine and see if it works that way. It may be failing and you
don't know. If you have access to the mail logs, check those out too.

-Micah


On Sat, 2003-01-18 at 12:48, Tony S.Wu wrote:


I need to send myself an email in one of my PHP page.
So i wrote the following code:

$result = ini_set(SMTP, smtp.earthlink.net);
	
if ($result)
{
	echo ini_get(SMTP);
	$result = mail([EMAIL PROTECTED], test, test123);
	
	if ($result)
		echo mail sent;
}

It always print mail sent, but I never got the email.
So I was wondering if Mail() request any send mail program to work.
Can anyone tell me?
Thanks.

Tony S. Wu


[EMAIL PROTECTED]

--
Raincross Technologies
Development and Consulting Services
http://www.raincross-tech.com





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




Re: [PHP-DB] [NB] Mail() question

2003-01-18 Thread Tony S . Wu
Ah, that must be it.
I am running a Mac OS X server, which is Darwin based.
Guess I should go with sendmail.
Thanks a lot.

Tony S. Wu
[EMAIL PROTECTED]


On Saturday, January 18, 2003, at 02:27 PM, Jason Wong wrote:


On Sunday 19 January 2003 04:48, Tony S. Wu wrote:

I need to send myself an email in one of my PHP page.
So i wrote the following code:

$result = ini_set(SMTP, smtp.earthlink.net);

if ($result)
{
	echo ini_get(SMTP);
	$result = mail([EMAIL PROTECTED], test, test123);

	if ($result)
		echo mail sent;
}

It always print mail sent, but I never got the email.
So I was wondering if Mail() request any send mail program to work.


Is it a windows server that you're using? SMTP only works for windows.
Anything else uses sendmail or equivalent.

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


/*
transient bus protocol violation
*/


--
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] Re: crosstab for MS SQL

2002-12-28 Thread Opec Kemp [ q u a s a r z ]
Hi,

I don't think you can do that with MS SQL, it doesn't support TRASFORN, I
think that's strictly Access syntax. MS SQL 7 and up does have ROLLUP etc
but that's part of the OLAP service, which you will only get if you have
Enterprise edition (read $$ :)).

The easiest way to get out of this is to use the CASE statement. For
example:

CREATE TABLE Pivot
( Year  SMALLINT,
  Quarter   TINYINT,
  Amount  DECIMAL(2,1) )
GO
INSERT INTO Pivot VALUES (1990, 1, 1.1)
INSERT INTO Pivot VALUES (1990, 2, 1.2)
INSERT INTO Pivot VALUES (1990, 3, 1.3)
INSERT INTO Pivot VALUES (1990, 4, 1.4)
INSERT INTO Pivot VALUES (1991, 1, 2.1)
INSERT INTO Pivot VALUES (1991, 2, 2.2)
INSERT INTO Pivot VALUES (1991, 3, 2.3)
INSERT INTO Pivot VALUES (1991, 4, 2.4)
GO

This is the SELECT statement used to create the rotated results:

SELECT Year,
SUM(CASE Quarter WHEN 1 THEN Amount ELSE 0 END) AS Q1,
SUM(CASE Quarter WHEN 2 THEN Amount ELSE 0 END) AS Q2,
SUM(CASE Quarter WHEN 3 THEN Amount ELSE 0 END) AS Q3,
SUM(CASE Quarter WHEN 4 THEN Amount ELSE 0 END) AS Q4
FROM Pivot
GROUP BY Year
GO

This will give you the result:

+---+-+--+--+-+
| Year  |  Q1 | Q2   | Q3   |  Q4 |
+---+-+--+--+-+
| 1990  | 1.1 | 1.2  | 1.3  | 1.4 |
+---+-+--+--+-+
| 1991  | 2.1 | 2.2  | 2.3  | 2.4 |
+---+-+--+--+-+

This works with MS SQL 7 and 2000. I don't know if 6.5 supports this though
:(


 -Original Message-
 From: MWCT - Markus Weber [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, 28 December 2002 5:34 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: crosstab for MS SQL


 Have you tried the MS Access Syntax ? - e.g.:

 TRANSFORM Sum(cube_by_c.netc_bd) AS [Summe von netc_bd]
 SELECT cube_by_c.pthr_product_c AS PROD_C, xref_prod.pthr_desc_x AS [DESC]
 FROM cube_by_c LEFT JOIN xref_prod ON cube_by_c.pthr_product_c =
 xref_prod.pthr_product_c
 WHERE (((cube_by_c.country_iso3_c)=DEU))
 GROUP BY cube_by_c.pthr_product_c, xref_prod.pthr_desc_x
 PIVOT cube_by_c.mm;

 regards,
 markus



 Sommai Fongnamthip [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi,
  MySQL has a method to write Crosstab method but It can't use with MS
  SQL.  Did someone know how to write SQL statement for make
 cross tab with
  MS SQL 6.5 (both ODBC and TDS connection)?
 
  Thank you
  SF
 



 --
 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] php/mysql

2002-12-26 Thread Martin S
I don't know where the error lays, in php, mysql or red hat 8.
But, I can't get my databased php-apps to work. 
I am trying to run:

apache_1.3.27
php-4.2.3
mysql-3.23.53
redhat 8.0

What happens is that apache and php work nicely, but my apps cannot connect 
to mysql. In IRM I get can not connect to database, and in phpgroupware I 
get the the thing up and running, but can't add anything to the tables.
E.g. I can't add a to-do even if the routine runs normally, nothing is added 
in the db table.

I saw a suggestion on a mysql mail list suggesting symlinking mysql.sock to 
/tmp but that does no difference.


Any suggestions?

/Martin S.

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




Re: [PHP-DB] php/mysql

2002-12-26 Thread Martin S
1lt John W. Holmes wrote:

 I don't know where the error lays, in php, mysql or red hat 8.
 But, I can't get my databased php-apps to work.
 I am trying to run:

 apache_1.3.27
 php-4.2.3
 mysql-3.23.53
 redhat 8.0

 What happens is that apache and php work nicely, but my apps cannot
 connect
 to mysql. In IRM I get can not connect to database, and in phpgroupware I
 get the the thing up and running, but can't add anything to the tables.
 E.g. I can't add a to-do even if the routine runs normally, nothing is
 added
 in the db table.

 I saw a suggestion on a mysql mail list suggesting symlinking mysql.sock
 to
 /tmp but that does no difference.
 
 Can you connect to MySQL from the command line? With what user? 

mysql -u ADMIN -pADMINPW irm
mysql -u ADMIN -pADMINPW phpgroupware

both work (command line access). Setting the user in IRM as ADMIN and the 
password to ADMINPW I get Cannot connect to database.
I once desperately thought I had forgotten to configure php --with-mysql so 
I recompiled. No improvement.

Are you
 sure you are using a valid login and password in your programs?

Yes. I'll recheck though.

/Martin S.



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




RE: [PHP-DB] How to solve T_STRING error?

2002-12-26 Thread Martin S
Josh Johnson wrote:

 I'd have to see all of your code, but I'm guessing you've left open a
 paren or a quotation mark, or a ?php ? block or forgot a
 semi-colon...probably in a file included before this code is called.
 
 Also, you may want to look into how PHP handles null values (I'm pretty
 sure they evaluate to false, but look into it), and try to verify that
 $user2-permissionCheck(tech); is returning a true/false/0/1 sort of
 result.

You are seeing everything down to line 43 (except an include statement as 
you guessed*). If I comment out the db lookup, 
the page works. Although not as intended (which the db-routine is supposed 
to fix).

I'll have another look though.

/Martin S.

* which is hell to debug, it's a 3500+ lines beastie.

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




Re: [PHP-DB] php/mysql

2002-12-26 Thread Martin S
Mark wrote:

 I don't use RedHat, but I've heard (possibly here) that the RH PHP
 RPM does not properly install MySQL support by default and that
 there's something like php_mysql.rpm (or something similar) that
 needs to be installed as well? Does any of that sound familiar to
 anyone?
 
I've heard something like that as well, which is why I've compiled php and
apache from source. Would compiling mysql from source as well help I 
wonder...

/Martin S.

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




[PHP-DB] How to solve T_STRING error?

2002-12-25 Thread Martin S
Just one page still to do. And I'm stuck.
I keep getting:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or 
`T_NUM_STRING' in /www/htdocs/dev/users/tracking-update.php on line 43

ON this code:

AuthCheck(post-only);
commonHeader(IRM Tracking - Update Information);
PRINT a href=\$HTTP_REFERER\Go Back/ahr noshadebr;
$datenow = date(Y-m-d H:i:s);
$user2 = new User($IRMName);
$type = $user2-getType();
$permissions = $user2-permissionCheck(tech);
$track = new Tracking($tID);
$isStat = $track-isStatus($status);
$isAssign = $track-isAssign($user);
$query = select dev_group from tracking where (ID=$tID);
$sth = $adb-prepare($query);
if($sth)
{
$res = $sth-execute();
$result = $sth-fetchrow_hash();
$dev_group = $result[dev_group];
}
if($permissions)// This is line 43
{
if(!$isStat)
{


and I can't see what ever is wrong! Probably have been looking too much at 
it. Anyone who can see an error in here somewhere?

/Martin S.

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




Re: [PHP-DB] How to solve T_STRING error?

2002-12-25 Thread Martin S
Jason Wong wrote:

 On Wednesday 25 December 2002 21:44, Martin S wrote:
 Just one page still to do. And I'm stuck.
 I keep getting:

 Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
 `T_NUM_STRING' in /www/htdocs/dev/users/tracking-update.php on line 43

 ON this code:

 AuthCheck(post-only);
 commonHeader(IRM Tracking - Update Information);
 PRINT a href=\$HTTP_REFERER\Go Back/ahr noshadebr;
 $datenow = date(Y-m-d H:i:s);
 $user2 = new User($IRMName);
 $type = $user2-getType();
 $permissions = $user2-permissionCheck(tech);
 $track = new Tracking($tID);
 $isStat = $track-isStatus($status);
 $isAssign = $track-isAssign($user);
 $query = select dev_group from tracking where (ID=$tID);
 $sth = $adb-prepare($query);
 if($sth)
 {
 $res = $sth-execute();
 $result = $sth-fetchrow_hash();
 $dev_group = $result[dev_group];
 }
 if($permissions)// This is line 43
 {
 if(!$isStat)
 {


 and I can't see what ever is wrong! Probably have been looking too much
 at it. Anyone who can see an error in here somewhere?
 
 It /looks/ OK, assuming that you have closing braces on the last two IF
 statements. Are you sure you're looking at the right file?
 
Yes unfortunately I am. I've checked both the closing braces and the file 
name umpteen times by now.

/Martin S.

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




RE: [PHP-DB] MySQL connectiviy

2002-11-22 Thread Pedro M. S. Oliveira
Hi Jeremy,
Probably you don't have all of php installed; you can pick it up in
php.net and install the full php libs.
Or in your php ini file, the php lib path can be incorrect, well these
are just thoughts as I don't use red hat for some time (SuSE Forever).
Hope you figure it out,
Pedro


-Original Message-
From: Jeremy Wood [mailto:[EMAIL PROTECTED]] 
Sent: sexta-feira, 22 de Novembro de 2002 18:35
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL connectiviy

Hello all,
I'm new to PHP and would like to start using mySQL (or postgresql) but I
keep having one problem. 
In a php file i have a simple call to the function
mysql_connect()

but i constantly get the error
Fatal error: Call to undefined function: mysql_connect() 

MySQL support was installed with
--with-mysql=shared,/usr' 
This is the redhat 8.0 default. I guess it just can't find the function
library.

Any pointers any one could give would be really appreciated.
Thanks,
Jeremy Wood



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




Re: [PHP-DB] Infinite Loop?

2002-11-02 Thread Tony S. Wu
I've seen no way to get out of the while loop.

Tony S. Wu
[EMAIL PROTECTED]

Nope, this world ain't perfect. But at least I know it's not because of
me.


Graeme McLaren at [EMAIL PROTECTED] wrote:

 Greetings list members.  I've written the code below as part of an
 automatic email script.  The problem with this is it seems to run in to
 an infinite loop.  The for loop seems to get completely ignored by
 emails get sent constantly.  I deleted the script after receiving 2500
 emails ! :'( 
 
 Can anyone point out what the problem with this is?
 
 while($tmp = $NowUnix)
 {
 
 for($i=0; $i=2; $i++)
 {
 $sendto = [EMAIL PROTECTED];
 $subject = Test Automatic Email;
 $message = If you get this then age3.php works
 $message = If you get this then age3.php works
 $message = If you get this then age3.php works;
 
 mail($sendto, $subject, $message);
 }
 }
 
 Cheers,
 
 Graeme :)




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




[PHP-DB] Free shopping cart

2002-10-20 Thread Tony S. Wu
I need to write a shopping cart for my friend's website.
I thought modifying a free one for my need would be easier.
Sorry for asking question like this.
But I've done the search on google and all I could find weren't free.
Can anyone provide me some links?
Thanks a lot.

Tony S. Wu
[EMAIL PROTECTED]

Nope, this world ain't perfect. But at least I know it's not because of
me.


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




Re: [PHP-DB] Free shopping cart

2002-10-20 Thread Tony S. Wu
Thanks a lot :D

Tony S. Wu
[EMAIL PROTECTED]

Nope, this world ain't perfect. But at least I know it's not because of
me.


Jason Wong at [EMAIL PROTECTED] wrote:

 On Sunday 20 October 2002 23:17, Tony S. Wu wrote:
 I need to write a shopping cart for my friend's website.
 I thought modifying a free one for my need would be easier.
 Sorry for asking question like this.
 But I've done the search on google and all I could find weren't free.
 Can anyone provide me some links?
 
 Try:
 
 www.zend.com
 freshmeat.net
 sourceforge.net
 
 and even:
 
 www.hotscripts.com




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




[PHP-DB] Help! Oracle help needed

2002-09-20 Thread Pedro M. S. Oliveira

Hi all the people here!
well i've been working with php for quite some time now but i never used
oracle databases before.
well the situation is something like this.
I've a mysql server running perfectly working with apache and php on
linux, but in the other hand i also have an oracle server (6i) running
with windows.
The prob is that now i need to update my mysql database every night. The
codding envolvind this is not the big problem, my main prob is How do i
do to make php to get the data from the oracle server since i don't have
any linux istallation with oracle?
Can i make php get the data from the oracle server just by ip as i can
do with mysql?
If so what do i need to have.
Thank you alot
 Geek Greetings,
Pedro Oliveira 



[PHP-DB] SELECT statement problem

2002-08-15 Thread Evan S. Weiner

Hello all,

I have this SQL statement I am trying to use and no matter what combination I use, I 
cannot get it to work.  The start and end if clauses need to be grouped together.

SELECT * FROM tickets_work WHERE employee_id = '$tech_id'  ( start  '$start'  end 
 '$end' ) ORDER BY start

Anyone able to help me?

Thanks!

Evan


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




RE: [PHP-DB] SELECT statement problem

2002-08-15 Thread Evan S. Weiner

It only outputs the first tech.  It worked fine until I tried to add the end date ino 
it.

Thanks for all teh help!

// Get technician info
$TECH_SQL = SELECT * FROM employees;
$TECH = MYSQL_QUERY( $TECH_SQL, $CONNECTION) OR DIE ( mysql_error() );

while ( $row = mysql_fetch_array( $TECH ) )
{
$tech_id = $row[id];
$tech_name_last = $row[name_last];
$tech_name_first = $row[name_first];

$tech_initials_first = substr( $tech_name_first, 0, 1 );
$tech_initials_last = substr( $tech_name_last, 0, 1);
$tech_initials = $tech_initials_first$tech_initials_last;

$tech_name = $tech_name_first $tech_name_last;

echo   table width=\100%\\n;
echo   p align=\center\ class=\big\$tech_name/p\n;

// Reset counters for this tech
$tech_hour = 0;
$tech_cost = 0;


// Start pulling ticket work
$TICKET_WORK_SQL = SELECT * FROM tickets_work
WHERE employee_id = '$tech_id'
AND start  '$start'
AND end  '$end'
ORDER BY start;
$TICKET_WORK_INFO = MYSQL_QUERY( $TICKET_WORK_SQL, $CONNECTION ) OR DIE ( 
mysql_error() );

while ( $row = mysql_fetch_array( $TICKET_WORK_INFO ) )
{
$ticket_id = $row[ticket_id];
$start = $row[start];
$end = $row[end];
$total_hours = $row[total_hours];
$total_billable = $row[total_billable];

-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT statement problem


SELECT * FROM tickets_work
WHERE employee_id = '$tech_id' AND
 start  '$start' AND
 end  '$end'
ORDER BY start

Which will select everything from tickets_work for a given employee between 
start and end. What is not working?

Miles Thompson

At 02:15 PM 8/15/2002 -0400, Evan S. Weiner wrote:
Hello all,

I have this SQL statement I am trying to use and no matter what 
combination I use, I cannot get it to work.  The start and end if clauses 
need to be grouped together.

SELECT * FROM tickets_work WHERE employee_id = '$tech_id'  ( start  
'$start'  end  '$end' ) ORDER BY start

Anyone able to help me?

Thanks!

Evan


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



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


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




[PHP-DB] Using functions in SELECT statements

2002-05-02 Thread Robin S McKenzie


I'm trying perform a case-insensitive test for a name.  These are stored
like Association of ..., and I want to convert both the filter and the
test data to lower- (or upper-) case.  Why doesn't this work:   ?

SELECT *
FROM [Organisation Membership]
WHERE lower(organisation) LIKE lower('%$SearchBox$%')

Robin McKenzie
Department of Mechanical Engineering
University of Bristol
e:[EMAIL PROTECTED]
e:[EMAIL PROTECTED]
m:+44(0)7970 058712




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




Re: [PHP-DB] Using functions in SELECT statements

2002-05-02 Thread Robin S McKenzie


If only it were that simple - sorry, that was a copying error...

It gives the error  undefined function: lower

R

Robin McKenzie Department of Mechanical Engineering University of Bristol
e:[EMAIL PROTECTED] e:[EMAIL PROTECTED] m:+44(0)7970 058712

Peter Lovatt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...



 Could it be the second $ in the lower('%$SearchBox$%') ?

 Peter



 ---
 Excellence in internet and open source software
 ---
 Sunmaia
 www.sunmaia.net
 [EMAIL PROTECTED]
 tel. 0121-242-1473
 ---

  -Original Message-
  From: Robin S McKenzie [mailto:[EMAIL PROTECTED]]
  Sent: 02 May 2002 14:34
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Using functions in SELECT statements
 
 
 
  I'm trying perform a case-insensitive test for a name.  These are stored
  like Association of ..., and I want to convert both the filter and the
  test data to lower- (or upper-) case.  Why doesn't this work:   ?
 
  SELECT *
  FROM [Organisation Membership]
  WHERE lower(organisation) LIKE lower('%$SearchBox$%')
 
  Robin McKenzie
  Department of Mechanical Engineering
  University of Bristol
  e:[EMAIL PROTECTED]
  e:[EMAIL PROTECTED]
  m:+44(0)7970 058712
  
 
 
 
  --
  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] Probably a stupid Array question

2002-03-30 Thread Demitrious S. Kelly

$words[0] would be the first word, $words[1] would be the second word...
$words[10] would be the eleventh word, etc, etc

-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, March 30, 2002 9:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Probably a stupid Array question

Hi there everyone,

I do this to explode my input line which consists of however many words:

$words = explode( , $testb);

Now i've done this and I presume that $words holds all the info as an
Array (new to arrays, sorry if i'm wrong) however, how can I put each
item of the array from $words into a different string?  IE:  if there
are 3 items, how could I have it so that the first word is stored in
$word1, the second words is stored in $word2 etc???  Please help, thank
you all so much :-)

Regards

Chris



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




[PHP-DB] Re: ODBC and images

2002-03-26 Thread Bruce S. Garlock

Although this article is more geared towards MySQL, the principles should apply to 
ODBC, and you should be able to translate the MySQL functions to ODBC functions rather 
easily.

http://www.phpbuilder.com/columns/florian19991014.php3





David Juras wrote:

 Hi,
 I'm working with PHP and ODBC to get images stored in a database (Blob fields). But 
I experiment little problems to display these pics. Has anyone any information about 
PHP/ODBC/images ?

 Thanks,

 Bilbo


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




Re: [PHP-DB] ODBC -- Setting ApplicationID

2002-03-26 Thread Bruce S. Garlock

I think that work-around may work for me.  Since I can declare a different
environment variable for the PHP script, with a new alias, that should work
fine.  Thanks for the suggestion.

- Bruce


Andrew Hill wrote:

 Bruce,

 It looks like you were on the right track initially, the problem is that PHP
 has a major bug - odbc_setoption is coded specific to ODBC statement handle
 (connection id), which means that trying to use odbc_setoption the way you
 want attempts to set a SQLSetConnectOption AFTER the connection is open -
 which is bogus and will give you ODBC function sequence errors.

 On the other hand, the error message you were getting is a bit misleading;
 we are fixing that now.

 So... you can unfortunately not do this via Application ID, but since you
 are using the OpenLink Rules Book, you can still affect Session-based
 connection management with any of the other connection criteria:

 Here is one way to do it:
 --
 Setup your session attributes by configuring the Session Rules Book Aliases
 section of the Multi-Tier OpenLink Admin Assistant.
 (http://servername:8000).

 You can configure session rules for any combination of Domain, Database,
 User, Operating System, Client Machine, Client Application, etc., and can
 control any connection options at the server side based on the session.

 Using Database as an example, add a Database Alias with a new database
 name and configure a session mapping rule to point to the original database
 name, but change the connection attributes from Read / Write to Read
 Only in the options for the  connection session.

 On the PHP side, simply choose between two DSN's in the odbc.ini - one is
 the normal DSN, with default settings, and one will have an alternate
 database name, name_readonly or somesuch, that will cause the oplrqb to
 instantiate the appropriate connection attributes.

 If you run into problems, you should probably open a support case at
 http://www.openlinksw.com/support/suppindx.htm, as this is getting somewhat
 off-topic for PHP.

 Hope this helps!

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

 I was thinking of using the usernames, but as people come and go, that might
 mean messing around with the oplrqb.ini file too much.  I'd really like to
 do
 this based on application.  What variable do I pass with the PHP script?
 ( I'm
 not sure what you mean ).  Can I use a variable in PHP that passes the
 application name to the server?

 Thanks,

 Bruce

 Andrew Hill wrote:

  Hi Bruce,
 
  The setoption error is being thrown because you cannot use
  SQLSetConnectOption that way.
  Passing arbitrary info to be used by your application isn't really what
 this
  is for, but instead can be used to modify parameters in the ODBC API.
 
  This means you can modify things like SQL_ACCESS_MODE, SQL_AUTOCOMMIT,
  SQL_ODBC_CURSORS, etc., (check the 2.x spec - there are several metadata
  items that you can control with this API call.)
 
  I'd recommend you just pass a variable to your PHP script, and perhaps
  change the username to a read-only/read-write user with  a case statement
 or
  somesuch, based on the application.
 
  Again, I'd strongly recommend you upgrade the OpenLink UDA version as
 well;
  1.5 is something like 5 years old or more.
 
  Best regards,
  Andrew Hill
  Director of Technology Evangelism
  http://www.openlinksw.com/virtuoso/whatis.htm
  OpenLink Virtuoso Internet Data Integration Server
 
   -Original Message-
   From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]]
   Sent: Monday, March 25, 2002 10:48 AM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP-DB] ODBC -- Setting ApplicationID
  
  
   Sure, I'm simply trying to have PHP pass an ApplicationID to the
   ODBC server.
   When a PHP script access the ODBC database, it does not set the
   application:
  
   10:46:04   connectopts= user=webuser opsys=unix machine=linux
 application=
  
   As you can see, application= is NULL.  I would like the script to pass
   something, so that my mapping rules on the server would allow
   write access to
   the db, if the PHP application sends a certain name.  Currently our
 Win32
   applications, like MS Access, send application names.  e.g. Access,
 sends:
   application=MSACCESS.
  
   Thanks for your help,
  
   Bruce
  
   Andrew Hill wrote:
  
Bruce,
   
I'm not sure what you are trying to do - could you clarify?
You may be able to simply use the OpenLink Rules Book to set
 role-based
authentication on domain, ip, application, etc.
   
Also, the ODBC Driver version (1.5) you are using is _very_ old and
unsupported.
I suggest you upgrade to 4.2
   
Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers

Re: [PHP-DB] ODBC -- Setting ApplicationID

2002-03-25 Thread Bruce S. Garlock

Sure, I'm simply trying to have PHP pass an ApplicationID to the ODBC server.
When a PHP script access the ODBC database, it does not set the application:

10:46:04   connectopts= user=webuser opsys=unix machine=linux application=

As you can see, application= is NULL.  I would like the script to pass
something, so that my mapping rules on the server would allow write access to
the db, if the PHP application sends a certain name.  Currently our Win32
applications, like MS Access, send application names.  e.g. Access, sends:
application=MSACCESS.

Thanks for your help,

Bruce

Andrew Hill wrote:

 Bruce,

 I'm not sure what you are trying to do - could you clarify?
 You may be able to simply use the OpenLink Rules Book to set role-based
 authentication on domain, ip, application, etc.

 Also, the ODBC Driver version (1.5) you are using is _very_ old and
 unsupported.
 I suggest you upgrade to 4.2

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

  -Original Message-
  From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, March 21, 2002 11:02 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] ODBC -- Setting ApplicationID
 
 
  I am trying to set the ApplicationID, when connecting to an ODBC
  datasource.  I have tried:
 
  odbc_setoption ($conn, 1, 1053, PHPAPP);
 
  And get a:
 
  SQL error: [iODBC][Driver Manager]Option type out of range, SQL state
  S1092 in SetConnectOption
 
  Basically, I want my PHP script to pass the application name to the ODBC
  server, so that I can set up a mapping on the server that allows write
  access when a certain application string is sent.
 
  PHP 4.06 (with file-upload patch)
  Openlink ODBC 1.5
  Linux Client
  SCO Informix 5 server
 
 
  TIA-
 
  Bruce
 
 
 
 
  --
  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] ODBC -- Setting ApplicationID

2002-03-25 Thread Bruce S. Garlock

I was thinking of using the usernames, but as people come and go, that might
mean messing around with the oplrqb.ini file too much.  I'd really like to do
this based on application.  What variable do I pass with the PHP script?  ( I'm
not sure what you mean ).  Can I use a variable in PHP that passes the
application name to the server?

Thanks,

Bruce



Andrew Hill wrote:

 Hi Bruce,

 The setoption error is being thrown because you cannot use
 SQLSetConnectOption that way.
 Passing arbitrary info to be used by your application isn't really what this
 is for, but instead can be used to modify parameters in the ODBC API.

 This means you can modify things like SQL_ACCESS_MODE, SQL_AUTOCOMMIT,
 SQL_ODBC_CURSORS, etc., (check the 2.x spec - there are several metadata
 items that you can control with this API call.)

 I'd recommend you just pass a variable to your PHP script, and perhaps
 change the username to a read-only/read-write user with  a case statement or
 somesuch, based on the application.

 Again, I'd strongly recommend you upgrade the OpenLink UDA version as well;
 1.5 is something like 5 years old or more.

 Best regards,
 Andrew Hill
 Director of Technology Evangelism
 http://www.openlinksw.com/virtuoso/whatis.htm
 OpenLink Virtuoso Internet Data Integration Server

  -Original Message-
  From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]]
  Sent: Monday, March 25, 2002 10:48 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] ODBC -- Setting ApplicationID
 
 
  Sure, I'm simply trying to have PHP pass an ApplicationID to the
  ODBC server.
  When a PHP script access the ODBC database, it does not set the
  application:
 
  10:46:04   connectopts= user=webuser opsys=unix machine=linux application=
 
  As you can see, application= is NULL.  I would like the script to pass
  something, so that my mapping rules on the server would allow
  write access to
  the db, if the PHP application sends a certain name.  Currently our Win32
  applications, like MS Access, send application names.  e.g. Access, sends:
  application=MSACCESS.
 
  Thanks for your help,
 
  Bruce
 
  Andrew Hill wrote:
 
   Bruce,
  
   I'm not sure what you are trying to do - could you clarify?
   You may be able to simply use the OpenLink Rules Book to set role-based
   authentication on domain, ip, application, etc.
  
   Also, the ODBC Driver version (1.5) you are using is _very_ old and
   unsupported.
   I suggest you upgrade to 4.2
  
   Best regards,
   Andrew Hill
   Director of Technology Evangelism
   OpenLink Software  http://www.openlinksw.com
   Universal Data Access  Data Integration Technology Providers
  
-Original Message-
From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 11:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] ODBC -- Setting ApplicationID
   
   
I am trying to set the ApplicationID, when connecting to an ODBC
datasource.  I have tried:
   
odbc_setoption ($conn, 1, 1053, PHPAPP);
   
And get a:
   
SQL error: [iODBC][Driver Manager]Option type out of range, SQL state
S1092 in SetConnectOption
   
Basically, I want my PHP script to pass the application name
  to the ODBC
server, so that I can set up a mapping on the server that allows write
access when a certain application string is sent.
   
PHP 4.06 (with file-upload patch)
Openlink ODBC 1.5
Linux Client
SCO Informix 5 server
   
   
TIA-
   
Bruce
   
   
   
   
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
   
   
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


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




[PHP-DB] ODBC -- Setting ApplicationID

2002-03-21 Thread Bruce S. Garlock

I am trying to set the ApplicationID, when connecting to an ODBC
datasource.  I have tried:

odbc_setoption ($conn, 1, 1053, PHPAPP);

And get a:

SQL error: [iODBC][Driver Manager]Option type out of range, SQL state
S1092 in SetConnectOption

Basically, I want my PHP script to pass the application name to the ODBC
server, so that I can set up a mapping on the server that allows write
access when a certain application string is sent.

PHP 4.06 (with file-upload patch)
Openlink ODBC 1.5
Linux Client
SCO Informix 5 server


TIA-

Bruce




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




[PHP-DB] Re: [PHP] Temporary MySQL Tables

2002-03-21 Thread John S. Huggins

On Thu, 21 Mar 2002, Georgie Casey wrote:

-Hi,
-
-membership with the username and timestamp in the URL. The users clicks it,
-and I run a SQL command that copies the row from tempmembers into the
-members table.

I assume you are building up all your fields as you move through the site.
I would just perform an INSERT into your tempmebers table right away
setting whatever fields you have at this point.  Then as I pass through
each data entry page, I would do UPDATES to that record updating only
those new fields, leaving the old ones alone and thus preserved.

This way you only have to pass a record ID and the new parameters on each
page thus eliminating moving data through the URL.  Yuk.

Anyway, that's what I would do.

-
-This process worked well for a while until I discovered if users enter a
-single or double quote into any of the fields, it fecks everything up. So I
-added an addslashes command but it's all getting a bit hairy so I was
-looking for some advice on MySQL temporary tables for either using after
-every form or at the end of all the forms.
-
-Or does anyone have any other method I could use??? Thanks for any help
-you might have.
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




[PHP-DB] oracle-mysql

2002-03-20 Thread Pedro M. S. Oliveira

hi all, i need to migrate an oracle database (+-1gb) to a mysql one, but i
don't have a clue how to do this.
i'm thinking in dumping the whole content of the oracle database to a txt
file but i don't know if there is a better way
any ideias on this one.
btw the oracle machine is running on windows 2000 server and the mysql one
is running on linux
i don't have php on either machines but the mysql i'll have a connection to
an apache running machine.
the prob here is... what is the better way to migrate the data?
thanx


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




RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Demitrious S. Kelly

Pass along a hidden form which documents exactly what rows have already
been shown

input type=hidden name=seen value=1:4:3:9:10:5:27

then you could use 

$seen=explode(':', $seen); to break it into an array...

after that use a foreach to add a 'and id != '.$seen into the sql query
for every element in $seen... thus not allowing duplicates on a per
visit basis...

-Original Message-
From: Georgie Casey [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 13, 2002 4:11 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Random Selecting from mySQL

yea, i know how to display 10 results per page, but that doesnt work
when
you want to do a ORDER BY rand() query.

Gurhan Ozen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 are you just looking for a way to display 10  results per page? If yes
then
 you can just use LIMIT to limit your result to 10 .. So, for the first
page,
 you can do SELECT  LIMIT 1, 10; and for the second page SELECT
...
 LIMIT 11, 20 etc etc .
   You can sure use ORDER BY with LIMIT to to sort the results for
a
 given criteria ..

 Gurhan


 -Original Message-
 From: Georgie Casey [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 13, 2002 2:00 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: [PHP-DB] Random Selecting from mySQL


 I know how to use the ORDER BY rand() command on the end of queries
to
 randomize selection, but that's no good when you want to only display
10
 results per page. The next page the user chooses, randomizes again and
could
 show duplicate fields and not at all show other fields.

 Does anyone know a way round this?

 --
 Regards,
 Georgie Casey
 [EMAIL PROTECTED]

 ***
 http://www.filmfind.tv
 Ireland's Online Film Production Directory
 ***



 --
 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] any php/Linux gurus out there?

2002-03-04 Thread Pedro M. S. Oliveira

you could complile the hole program instead of the rpm, just read
README.install from the php source tar file.
or you can install the other rpms that are lacking.
or even so, not such a good ideia, but you can force the installationg
using the command
rpm -i --nodeps php
or
rpm -U --nodeps phpxxx

- Original Message -
From: Peter Lovatt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 04, 2002 11:52 PM
Subject: [PHP-DB] any php/Linux gurus out there?


 Hi

 I am running the security upgrade and am getting the following error when
I
 run the RPM
 The install is RH 7.0 and was pre-installed. I had assumed that the RPMs
 from Redhat would match the pre installed version, as it was standard.

 I am a humble programmer (and part time sys admin!), rather than a
Linux/RH
 guru, so would appreciate some advice. What is the best way to deal with
 this ?


 error: failed dependencies:
 libcrypto.so.1 is needed by php-4.0.6-9.7.0
 libmm.so.11 is needed by php-4.0.6-9.7.0
 libssl.so.1 is needed by php-4.0.6-9.7.0
 libcrypto.so.1 is needed by php-imap-4.0.6-9.7.0



 ---
 Excellence in internet and open source software
 ---
 Sunmaia
 www.sunmaia.net
 [EMAIL PROTECTED]
 tel. 0121-242-1473
 ---

 sql table


 --
 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] I'm really stuck!

2002-02-28 Thread Billy S Halsey

Hi Jennifer. Change {$session[uid]} to {$session['uid']} -- double 
quotes to single quotes. It's inside a set of single quotes already, so 
you have to use double quotes.

/bsh/

Jennifer Downey wrote:

Hi all, 

I'm really stuck and I'm not asking anyone to re-write this just show me what is 
wrong, or explain why it wont work. It just seems logical that this should work.

The first query will print the pet id in the browser.

$query=SELECT  id FROM wt_users WHERE uid={$session[uid]};
$ret = mysql_query($query);
while(list($pet)=
mysql_fetch_row($ret))
print(BRyour pet id is $pet);

So if $pet will print the id from the wt_users (has a value of 3) and I assign $id = 
$pet (id also has a value of 3 in image_data)  why doesn't it show the image?

if($id) {


$id = $pet;
$query = select bin_data,filetype from image_data where id=$id;
 
  $result = mysql_query($query);

$data = mysql_query($result,0,bin_data);
$type = mysql_query($result,0,filetype);

Header( Content-type: $type);
echo $data;

};
echo img src=\petdata.php?id=$id\;

Thanks
Jennifer Downey


-- 

/-=[ BILLY S HALSEY ]=--\
| Member of Technical Staff - Sun Microsystems, Inc.|
| ESP Solaris Software - Software Problem Resolution Team   |
| No day but today. - J. Larson, RENT x55403/858-526-9403 |
\--=[ [EMAIL PROTECTED] ]=/




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




Re: [PHP-DB] Finding records with NULL values

2002-02-26 Thread Billy S Halsey

Hi Robin,

Use a standard select like you normally would, and in your where clause, 
use where [field] is null :

select field1[, field2, ...] from table1[, table2, ...] where fieldx 
is null [...]

-bsh

Robin McKenzie wrote:

I have a table of questions, and a table of responses (initially empty)
which gets updated every time an answer is submitted, with the question
number, member id and response.

I wish to produce a SELECT query that will find the questions that haven't
been answered by a particular member, i.e. a query that finds the questions
that DO NOT have an entry in responses.  How can I do this?

Regards,

Robin



-- 


/-=[ BILLY S HALSEY ]=--\
| Member of Technical Staff, Sun Microsystems, Inc. ESP Solaris SW  |
| All opinions and technical advice offered in this message are my |
| own and not necessarily endorsed by my employer. |
\--=[ [EMAIL PROTECTED] ]=/




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




Re: [PHP-DB] PHP IDE

2002-02-23 Thread Billy S Halsey



Aron Pilhofer wrote:

After spending two frustrating hours tracking down a bug yesterday - only to
discover it was a misplaced quote mark. I've had it.

I am looking for suggestions out there for a good IDE for PHP development,
preferably one that doesn't cost an arm and a leg. I tried PHP4EE studio,
but it is buggy as hell and kept crashing on me.

Thanks in advance.



If you work in a primarily *nix environment like me, there are quite a few options. I 
have used JEdit, Nedit, and, most recently, Vim. I really prefer Vim over all the 
others because of its extremely flexible configuration, plus it uses standard vi 
commands and features. I actually use the GUI version, gvim, and the syntax 
highlighting, paren/brace matching, auto indent, etc., are all superb.

There are other options as well for *nix systems. Of course there's (X)Emacs, plus 
some commercial suites like Crisp and Visual SlickEdit, but I've found that the 
commercial products like Crisp and VS just aren't really cut out for PHP coding.

There's also a nice webpage with links to some other PHP editors for a variety of 
platforms. Take a look at http://www.itworks.demon.co.uk/phpeditors.htm. I have found 
some nice editors from this list.

Regards,
/bsh/

-- 


/-=[ BILLY S HALSEY ]=--\
| Member of Technical Staff, Sun Microsystems, Inc. ESP Solaris SW  |
| All opinions and technical advice offered in this message are my |
| own and not necessarily endorsed by my employer. |
\--=[ [EMAIL PROTECTED] ]=/




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




Re: [PHP-DB] newbe: how to import a whole db from an .sql file

2002-02-21 Thread Billy S Halsey

Hi Steven,

The problem is that when doing mysql_query (et al) from PHP, you DON'T 
specify the semicolon (;) at the end of a query. If you want to import 
this back into MySQL, do the following:

1. Go into mysql and recreate the database manually -- the dump from 
mysqldump does NOT have a command to recreate the db.
2. Run mysql  textfile.sql, where textfile.sql is the dumpfile 
that was created. Be sure to use the -p option if you need to specify a 
password.

Good luck.

-bsh

steven wrote:

I'm moving a mySQL db from my own server over to an external hosting
company. there I don't have any root access of course... so I log in the
mySQL-console.

I made a 'db-dump' of my mySQL db (with Webmin), so I've got a textfile with
a large amount of SQL-statements inside. (CREATE TABLE and INSERT INTO's)

I tried the usual connection to the db, and then:

@mysql_db_query('dbname', $myQ, $lid);

where $myQ is a string of the whole textfile. I get this error:

1064You have an error in your SQL syntax near '; INSERT INTO ISshipping
VALUES (8,'966637132','EWW','Emery Worldwide','EWW93' at line 20

it seems as if the first sql-statement is ok, but the query command from php
can't handle multiple statements devided by the ';'...

How can I import the whole file?

tnx for any help!




-- 

===
Billy S Halsey  Software Problem Resolution
ESP Solaris Software
Email [EMAIL PROTECTED]Sun Microsystems, Inc
   -NO DAY BUT TODAY-
===




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




[PHP-DB] Do persistent dba_popen connections work ?

2002-01-29 Thread S A


I'm trying to use Berkeley DB db2 files with PHP persistent connection dba_popen. When 
I try persistent connections with dba_open then sometimes I don't get reads working  
I never get insert/replace working. Without persistent connections reading  writing 
work fine.

Has anyone else gotten persistent dba_popen connections working ?

- Sam.



-
Do You Yahoo!?
Yahoo! Auctions Great stuff seeking new owners! Bid now!


[PHP-DB] Re: [binarycloud-dev] Re: [PEAR-DEV] Re: [metabase-dev] RE:[PEAR-DEV] New Metabase Aniversary release

2002-01-25 Thread Stig S. Bakken

On Tue, 2002-01-22 at 22:17, Alex Black wrote:
  Template classes are also foundation components of modern
  applications.
 
 They are certainly important, but they do not prevent interoperability in
 the same way that different database abstraction packages do.
 
  application, using APIs that are slightly different is a bad thing.
  
  Of course, but no one forces you to do that. I, as a developer,
  can choose if I want to use PEAR::Metabase in my application
  or PEAR::DB.
 
 Yes, which is not a good idea. If you're tying to get people to use a common
 set of high quality classes, you'll need to introduce some standards.
 
  Remember, PEAR ist not Midgard. PEAR is no application framework.
  It's a pool of classes that follow coding standards.
 
 As the project leader of binarycloud, which is an application framework that
 uses some limited amount of PEAR code, I am obviously aware of the
 difference. I have no interest in PEAR as an application framework, I like
 it as it is: pool of classes that follow coding standards.
 
 It has been repeated over, and over, and over again that PEAR is not CPAN.
 If PEAR will allow multiple versions of a foundation component like database
 abstraction, then PEAR certainly is CPAN, with coding standards added.
 
 CPAN is huge and tangled because its owners did not want to make decisions.
 PEAR can be that as well, though given the extremely limited CVS access to
 the repository it doesn't strike me as a CPAN clone, it strikes me as a
 concerted effort to come up with a set of base classes for common needs in
 the development community. Thus my argument for one abstraction layer. if
 you guys are building CPAN with coding standards, great, but say so. I and
 no doubt others will finally shut up about this question and we can all get
 on with writing code and designing stuff that works.
 
 This points to the age-old problem with PEAR: no one can decide what it
 actually is, so this argument comes up in different forms about once every
 three months.
 
 Just decide: is PEAR:
 -CPAN with coding standards
 -PHP Base Classes
 
 That's a big difference.

I'm currently writing The PEAR Manifest, a document that clearly
defines PEAR once and for all.  I'll post the first draft on pear-dev
here when it's done, but to answer your question, there has been talk
about a core set of packages for a while.  In the manifest these are
called PFC (PHP Foundation Classes), although it will not say which
packages the PFC includes.  The manifest also covers PECL, and how PEAR
relates to applications and frameworks.

 - Stig


-- 
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: [PEAR-DEV] Re: [binarycloud-dev] Re: [PEAR-DEV] Re:[metabase-dev] RE: [PEAR-DEV] New Metabase Aniversary release

2002-01-25 Thread Stig S. Bakken

On Tue, 2002-01-22 at 22:24, Björn Schotte wrote:
 * Alex Black wrote:
   Of course, but no one forces you to do that. I, as a developer,
   can choose if I want to use PEAR::Metabase in my application
   or PEAR::DB.
  Yes, which is not a good idea. If you're tying to get people to use a common
  set of high quality classes, you'll need to introduce some standards.
 
 But furthermore you need to assure that you don't influence
 people too much while promoting PEAR as the new solution on
 PHP's heaven.
  
  difference. I have no interest in PEAR as an application framework, I like
  it as it is: pool of classes that follow coding standards.
 
 Yep.
  
  If PEAR will allow multiple versions of a foundation component like database
  abstraction, then PEAR certainly is CPAN, with coding standards added.
 
 I really don't think so. If it would be, I can't see any
 disadvantages. Why should PEAR people force the developers
 to use the one and only DB abstraction class?

Nobody is forcing anyone to do anything, but the fact is that if you
want to make components that deal with databases, you need to support
one or more database APIs.  Most people will feel that supporting
several database abstraction layers is a waste of time, so we wish to
provide _one_ API that all PEAR components can leverage.  If we are too
chicken to make this decision, we can't make interoperable components.

Now we've even decided to merge PEAR DB and Metabase, and today it seems
most people are tired of having multiple database layers, and welcome
this effort.  I don't understand why this is an issue for you, could you
explain?

 - Stig


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

2002-01-13 Thread Pedro M. S. Oliveira



Hi all, first of all i'm sorry to ask this but i am getting lazy and i bet
you all can answer me in a couple of code lines.
i want to add some days to the the result of the date php function.
how can i had lets say 3 days?
ex:
(pseudo code)

?
$date =date(,mm,dd);
$date =date(,mm,dd) + 3days;
echo $date;
echo thank you all;
?

Thanks
Pedro


-- 
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] simultaneous dual table entry

2002-01-10 Thread Marc S. Bragg

Hi,

Is there a process for entry from one form to

--
Marc S. Bragg
[EMAIL PROTECTED]
Bialecki  Bragg, PC
p: 610-444-7508
f: 610-444-7548

http://www.chescolawyers.com/BB
Legal Directory, Services  Consumer Information for Chester County



-- 
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] simultaneous dual table entry

2002-01-10 Thread Marc S. Bragg

Hi,

Is there a process / command for inserting information from one form one
input into two separate tables in the same database? Anyone have the
basic command statement?

thanx mucho'

Marc
--
Marc S. Bragg
[EMAIL PROTECTED]
Bialecki  Bragg, PC
p: 610-444-7508
f: 610-444-7548

http://www.chescolawyers.com/BB
Legal Directory, Services  Consumer Information for Chester County



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




Re: [PHP-DB] mysql_num_rows

2002-01-06 Thread Richard S. Crawford

It would help if we could see the actual query.  It sounds like the problem 
is a syntax error in the query itself.

At 11:52 AM 1/6/2002, Gurhan Ozen wrote:
   Hi everyone,
  I have a problem with mysql connectivety which is making me nuts. If the
query is select blah, blah from table (i.e. without where clause)
mysql_num_rows returns the right number, but when i put in a query with
where clause, although there are rows returned, PHP is giving:
Warning: Supplied argument is not a valid MySQL result resource error..
Can anyone point me to any direction about this?
   Thanks.

Gurhan


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


Sliante,
Richard S. Crawford

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

It is only with the heart that we see rightly; what is essential is 
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!


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




RE: [PHP-DB] mysql_num_rows

2002-01-06 Thread Richard S. Crawford

Hm, if the result you want is the number of distinct nodeid values, why not 
use a query like this:

select count(distinct(nodeid)) as nodecount from books where bookid = 
$bookid;

Then the number of nodeid's is stored in nodecount.

You might also want to look into the GROUP BY clause.  That might give you 
a better handle on what you want to do.




At 12:09 PM 1/6/2002, Gurhan Ozen wrote:

I am pretty sure that the query is correct. here is the actual query:
 $query=select  distinct(nodeid), nodename  from books where
bookid=$bookid;
 $result=mysql_query($query);
 $num_results=mysql_num_rows($result);

  I have loaded a book into the tabel called books. I have gave each
section a nodeid and each book a bookid. SO i wanted to get number of
distinct nodeid's (i.e. sections) in the book so that i could use a for loop
to display all of them and an inner for loop to display each page under each
section.
   The funny thing is that if i write the same query without where
bookid=$bookid then the mysql_num_rows works but with where statement it
doesn't.
  By the way the web hoster i am using has PHP Version 4.0.6 .
   Thanks.
Gurhan


Sliante,
Richard S. Crawford

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

It is only with the heart that we see rightly; what is essential is 
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!


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




Re: [PHP-DB] MySQL: Reverse Order by???

2001-12-19 Thread Richard S. Crawford

ORDER BY field DESC

At 07:27 AM 12/19/2001, Brian Grayless wrote:
How you do a reverse order by in SQL, kind of like ORDER BY field only
reverse the order???


Sliante,
Richard S. Crawford

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

It is only with the heart that we see rightly; what is essential is 
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!


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




  1   2   >