Re: [PHP-DB] Shift_JIS Character Set

2003-12-12 Thread Jason Wong
On Friday 12 December 2003 14:47, Ng Hwee Hwee wrote:

> i'm doing a form (form.php)
> 1) user comes to form.php
> 2) user enters details and press submit
> 3) details get passed to form action verify.php
> 4) verify.php puts all the $_POST into an array $formVars
> 5) verify.php session_register("formVars")
> 6) if there is an error, verify.php sends user back to form.php
> 7) form.php echos all the $formVars (i.e. details that user has previously
> entered) in their respective textfields, together with the error messages
>
> i need to stripslashes at Step7 because as you have mentioned in a previous
> post on this list, magic_quotes_gpc added slashes to all my $_POST. Thus,
> since I need to echo them, I need to stripslashes.. I tried echoing the
> $formVars without the stripslashes and I see all the slashes before the
> quotes and backslashes etc.. so, by right, with English characters, i still
> need to stripslashes.

OK, if you *know* that the data has been through addslashes() (or equivalent 
eg magic_quotes_gpc) then doing a strip_slashes() should revert the data to 
its original form.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
The sheep that fly over your head are soon to land.
*/

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



Re: [PHP-DB] Shift_JIS Character Set

2003-12-12 Thread Ng Hwee Hwee
yes, and that's why i'm appealing for help on how to stripslashes when it
comes to the Shift_JIS character set...

will really appreciate advises! thanx lots!


- Original Message -
> OK, if you *know* that the data has been through addslashes() (or
equivalent
> eg magic_quotes_gpc) then doing a strip_slashes() should revert the data
to
> its original form.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *

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



RE: [PHP-DB] NEXTVAL Question

2003-12-12 Thread N . A . Morgan
put the schema name before the sequence object you need to increment, i.e.

$sql = "select SCHEMA.TEAM_SEQ.NEXTVAL as \"nextval\" from sys.dual";

Regards,
Neil Morgan

-Original Message-
From: Paul Miller [mailto:[EMAIL PROTECTED] 
Sent: 12 December 2003 00:05
To: [EMAIL PROTECTED]
Subject: [PHP-DB] NEXTVAL Question


Does anyone know how to make this work???

$sql = "select TEAM_SEQ.NEXTVAL as \"nextval\" from sys.dual";

I get the following error in PHP:

ociexecute(): OCIStmtExecute: ORA-00903: invalid table name

But when I use my SQL tool to hit the DB will all the same parameters, it
works just fine.

I have also tried:
$sql = "select TEAM_SEQ.NEXTVAL from sys.dual";
$sql = "select TEAM_SEQ.NEXTVAL from dual";

all with the same results.

I am running Red Hat AS, PHP 4.3, OCI8 Functions and Oracle 9i.

- Paul

-- 
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] Need help!!!

2003-12-12 Thread irinchiang


Hi..

Anyone can help me with this script???I kept getting error saying i did not 
define the variable "$tutor_id" and whenever I define it as $tutor_id = $_POST
['tutor_id'], I got error saying there was an "Undefined index"!
What was exactly the problem??
Need help desperately , greatly appreciate any suggestions/help/solutions 
given...

---

===edit.php 
 
$dsn = "mysql://root:[EMAIL PROTECTED]/tb1"; 
$db = DB::connect ($dsn); 

   if (DB::isError ($db)) 
   die ($db->getMessage()); 

$action = $_GET["action"]; 

if($action == "delete") 
{ 
$sql = mysql_query ("DELETE FROM tutor WHERE tutor_id='$tutor_id'"); 
} 

if($action == "edit") 
{ 
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id 
='$tutor_id'");**ERROR HERE!!* 

$row = mysql_fetch_array($sql); 

echo ""; 
echo "Tutor ID : ".$row['tutor_id'].""; 
echo ""; 
echo "Name : "; 
echo "Contact No : "; 
echo "E-mail : "; 
echo "Profile : "; 
echo ""; 
echo ""; 

} 
?> 

$result = $db->query($sql); 

if( DB::isError($result) ) { 
die ($result->getMessage()); 
} 
---


Irin.

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



RE: [PHP-DB] Need help!!!

2003-12-12 Thread Griffiths, Daniel
how are you getting the $tutor_id var?, in your script you are using "$action = 
$_GET["action"];" so you will need to define $tutor_id like $tutor_id = 
$_GET['tutor_id'], or just use $_GET['tutor_id'].

a form can only put variables in the POST array OR the GET array, and if your using 
hyperlinks to access this script then they will of course be GET vars. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 12 December 2003 09:38
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Need help!!!




Hi..

Anyone can help me with this script???I kept getting error saying i did not 
define the variable "$tutor_id" and whenever I define it as $tutor_id = $_POST
['tutor_id'], I got error saying there was an "Undefined index"!
What was exactly the problem??
Need help desperately , greatly appreciate any suggestions/help/solutions 
given...

---

===edit.php 
 
$dsn = "mysql://root:[EMAIL PROTECTED]/tb1"; 
$db = DB::connect ($dsn); 

   if (DB::isError ($db)) 
   die ($db->getMessage()); 

$action = $_GET["action"]; 

if($action == "delete") 
{ 
$sql = mysql_query ("DELETE FROM tutor WHERE tutor_id='$tutor_id'"); 
} 

if($action == "edit") 
{ 
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id 
='$tutor_id'");**ERROR HERE!!* 

$row = mysql_fetch_array($sql); 

echo ""; 
echo "Tutor ID : ".$row['tutor_id'].""; 
echo ""; 
echo "Name : "; 
echo "Contact No : "; 
echo "E-mail : "; 
echo "Profile : "; 
echo ""; 
echo ""; 

} 
?> 

$result = $db->query($sql); 

if( DB::isError($result) ) { 
die ($result->getMessage()); 
} 
---


Irin.

-- 
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] Need help!!!

2003-12-12 Thread irinchiang


Yes I'm using a hyperlink to access this page (see below)
echo "Modify";

and so I defined my variable "$tutor_id" as $tutor_id = $_GET['tutor_id'];
but i still got the error: "Undefined index: tutor_id 
in /usr/local/apache/htdocs/tutor/edit.php "

WHat could be the problem?;(


---

how are you getting the $tutor_id var?, in your script you are using "$action 
= $_GET["action"];" so you will need to define $tutor_id like $tutor_id = $_GET
['tutor_id'], or just use $_GET['tutor_id']. 

a form can only put variables in the POST array OR the GET array, and if your 
using hyperlinks to access this script then they will of course be GET vars. 

-Original Message- 
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 12 December 2003 09:38 
To: [EMAIL PROTECTED] 
Subject: [PHP-DB] Need help!!! 




Hi.. 

Anyone can help me with this script???I kept getting error saying i did not 
define the variable "$tutor_id" and whenever I define it as $tutor_id = $_POST 
['tutor_id'], I got error saying there was an "Undefined index"! 
What was exactly the problem?? 
Need help desperately , greatly appreciate any suggestions/help/solutions 
given... 

---
 

===edit.php 
 
$dsn = "mysql://root:[EMAIL PROTECTED]/tb1"; 
$db = DB::connect ($dsn); 

   if (DB::isError ($db)) 
   die ($db->getMessage()); 

$action = $_GET["action"]; 

if($action == "delete") 
{ 
$sql = mysql_query ("DELETE FROM tutor WHERE tutor_id='$tutor_id'"); 
} 

if($action == "edit") 
{ 
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id 
='$tutor_id'");**ERROR HERE!!* 

$row = mysql_fetch_array($sql); 

echo ""; 
echo "Tutor ID : ".$row['tutor_id'].""; 
echo ""; 
echo "Name : "; 
echo "Contact No : "; 
echo "E-mail : "; 
echo "Profile : "; 
echo ""; 
echo ""; 

} 
?> 

$result = $db->query($sql); 

if( DB::isError($result) ) { 
die ($result->getMessage()); 
} 
---
 


Irin. 

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



RE: [PHP-DB] Need help!!!

2003-12-12 Thread Griffiths, Daniel
you have the GET var in the hyperlink down as just 'id' not 'tutor_id', so change the 
hyperlink to 

echo "Modify";

or the the get var to $tutor_id = $_GET['id'];

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 12 December 2003 10:02
To: Griffiths, Daniel
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Need help!!!




Yes I'm using a hyperlink to access this page (see below)
echo "Modify";

and so I defined my variable "$tutor_id" as $tutor_id = $_GET['tutor_id'];
but i still got the error: "Undefined index: tutor_id 
in /usr/local/apache/htdocs/tutor/edit.php "

WHat could be the problem?;(


---

how are you getting the $tutor_id var?, in your script you are using "$action 
= $_GET["action"];" so you will need to define $tutor_id like $tutor_id = $_GET
['tutor_id'], or just use $_GET['tutor_id']. 

a form can only put variables in the POST array OR the GET array, and if your 
using hyperlinks to access this script then they will of course be GET vars. 

-Original Message- 
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 12 December 2003 09:38 
To: [EMAIL PROTECTED] 
Subject: [PHP-DB] Need help!!! 




Hi.. 

Anyone can help me with this script???I kept getting error saying i did not 
define the variable "$tutor_id" and whenever I define it as $tutor_id = $_POST 
['tutor_id'], I got error saying there was an "Undefined index"! 
What was exactly the problem?? 
Need help desperately , greatly appreciate any suggestions/help/solutions 
given... 

---
 

===edit.php 
 
$dsn = "mysql://root:[EMAIL PROTECTED]/tb1"; 
$db = DB::connect ($dsn); 

   if (DB::isError ($db)) 
   die ($db->getMessage()); 

$action = $_GET["action"]; 

if($action == "delete") 
{ 
$sql = mysql_query ("DELETE FROM tutor WHERE tutor_id='$tutor_id'"); 
} 

if($action == "edit") 
{ 
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id 
='$tutor_id'");**ERROR HERE!!* 

$row = mysql_fetch_array($sql); 

echo ""; 
echo "Tutor ID : ".$row['tutor_id'].""; 
echo ""; 
echo "Name : "; 
echo "Contact No : "; 
echo "E-mail : "; 
echo "Profile : "; 
echo ""; 
echo ""; 

} 
?> 

$result = $db->query($sql); 

if( DB::isError($result) ) { 
die ($result->getMessage()); 
} 
---
 


Irin. 

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



[PHP-DB] Thanks alot Griffiths!=)

2003-12-12 Thread irinchiang


Thanks alot for your help! That was very careless of me..;p I was stil quite a 
newbie to php-db coding...

By the way one last favour to ask of u hope u dun mind...

I have a script which was used to INSERT data into the database:
(See script below):

But everytime when I execute it I got the error "DB constraint"

I think the problem lies here:

$sql = "INSERT INTO tutor (tutor_name, tutor_contact, tutor_email, 
tutor_profile)
VALUES ($tutor_name,$tutor_contact,$tutor_email,$tutor_profile)";

Whenever I single quote the string value:
 VALUES ($tutor_name','$tutor_contact','$tutor_email','$tutor_profile')";
it actually insert a NULL value into the DB though I did enter values into the 
text field.But if I dun quote it, I got the error:
"DB constraint". By right I ought to quote it right??
I have gone thru my code umpteen times but to no avail. 
Where have i gone wrong??? ;(

---

$dsn = "mysql://root:[EMAIL PROTECTED]/table1";

$db = DB::connect ($dsn);
   if (DB::isError ($db))
   die ($db->getMessage());

//create variables ready to go into DB

$tutor_name = $db->quote($_POST["tutor_name"]);
$tutor_contact = $db->quote($_POST["tutor_contact"]);
$tutor_email = $db->quote($_POST["tutor_email"]);
$tutor_profile = $db->quote($_POST["tutor_profile"]);

$sql = "INSERT INTO tutor (tutor_name, tutor_contact, tutor_email, 
tutor_profile)
VALUES ($tutor_name,$tutor_contact,$tutor_email,$tutor_profile)";

$result = $db->query($sql);
  if( DB::isError($result) ) {
die ($result->getMessage());
}
?>

Add Tutor










"  
method="post">



 Name:
 
   

Contact No:

   

Email:
 
   


Profile:
 





 

   








Teacher:




Contact No:





E-mail Address:





Profile:










---
(I'm terribly sorry if the code is kinda messy)

All help are greatly appreciated!

Irin.

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



Re: [PHP-DB] pg_result_error()

2003-12-12 Thread Martin Marques
El Vie 12 Dic 2003 00:09, Gerard Samuel escribió:
> What good is this function?
> A quick example of the wall Im running into ->
> $sql = 'INSERT INTO .';
> $result = pg_query($conn_id, $sql);
> if ($result === false)
> {
> var_dump( pg_result_error( $result ) );

I would use here this:
die(pg_result_error( $result ));

> }
>
> According to the manual, pg_result_error takes the result resource.
> If that resource is boolean false for one reason or another, then
> pg_result_error isn't useful.
> Anyone has any other ideas, besides using
> pg_last_error()?

Did you try it?

-- 
 08:43:01 up 16 days, 14:59,  2 users,  load average: 0.20, 0.37, 0.36
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

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



[PHP-DB] More of a question rather than seeking code. :)

2003-12-12 Thread JeRRy
Hi,

Okay I don't want any code here, well not yet, I am
just wondering if this is possible.  And:

- Is it secure/safe ?
- Will it use alot of resources ?
- Will it harm my system or create security holes ?
- Will it do anything bad ? :P
- Should I do it or should I not ? (if it is possible)

Okay I will try and make this as short as possible and
to the point.

I have a database which lists User Account
Information.  But the thing I want to point out here
is the email address that is stored.  Okay I get this
email address and use PHP mail() and send out emails. 
Now some people put bad emails in the database from
time to time or emails go over quota and what-not.  So
some bounce, now if it bounces it goes to my 'root'
email account for that account.  By doing this it is
using up valuable quota and just bogging the system
down sitting in there waiting for a human to delete
them out.  (It get's quite annoying having to go in
there and delete them daily, weekly, monthly or
whatever as they are rubbish emails anyways with
bounced emails.)

I just recently added a flag in the database so if the
email bounces I manully flag the account as a bad
email so in future emails won't be sent to that users
email unless they correct their email.  This is time
consuming.

I use Horde for my mail client, it is web-based for
people who don't know what Horde is.

Now is it possible to do some code up to do the
following taks:

- Login to webmail using user and pass
- Open each email (each email is URL'd by a id code)
- Read the email but only fetch the email address of
the email that bounced (generally this is found on the
same line with most web mail servers responses)
- Use the email address to find a match in the User
Database and when a match is found flag the account as
a bad email
- Than delete the email from webmail

Very complicated I know.  Is this possible and is it
safe if it is? (i mean can anyone easily get the
information and user pass etc?)

Now what I would prefer to happen is the jobs ran in
the background without me needing to do it.. Maybe via
a cronjob or something.  But not sure if some code can
ge done up to do all these tasks as it needs to do
many tasks so probably will need to run as a
background processor?

But if it comes downt to crunch and it's safe etc and
I can do up some code that I just activate via a web
page and let it do it's thing I don't mind.  But not
sure if it is possible or if I am better to use perl
instead of PHP?  Any suggestions?

This project may never happen but I am hoping someone
has either tried this or has some idea of how to
achieve it or achieve part of it to make things easier
for me.

If you need further information please reply.  

Jerry


http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.

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



Re: [PHP-DB] More of a question rather than seeking code. :)

2003-12-12 Thread Jason Wong
On Friday 12 December 2003 20:15, JeRRy wrote:

[snip]

> I just recently added a flag in the database so if the
> email bounces I manully flag the account as a bad
> email so in future emails won't be sent to that users
> email unless they correct their email.  This is time
> consuming.

[snip]

Do yourself a big favour and setup something using a real mailing-list 
software. Any decent mailing-list manager will handle bounces automatically. 
Sustained bounces from an email address will eventually lead it to being 
suspended or unsubscribed automatically.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Youth.  It's a wonder that anyone ever outgrows it.
*/

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



[PHP-DB] anyone trickier than 'LIKE' ?

2003-12-12 Thread Hadi
Hi all,
I have this data (eg.) "..big fat buddy..." on the database . If
a person enter "big buddy" in the search form , the "...big fat
buddy." data will not be found . Any suggestion ?
Thanks in advance.


select * from table where data like "%keywords%";

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



Re: [PHP-DB] anyone trickier than 'LIKE' ?

2003-12-12 Thread Larry E . Ullman
I have this data (eg.) "..big fat buddy..." on the 
database . If
a person enter "big buddy" in the search form , the "...big fat
buddy." data will not be found . Any suggestion ?
select * from table where data like "%keywords%";
You can break up the search terms into words and do
...data LIKE '%$keyword[0]%' OR data LIKE '%$keyword[1]%'...
This will be slow though. You could also do full text searches if you 
are using MySQL. Have good indexes for whichever route you go.

Larry

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


RE: [PHP-DB] anyone trickier than 'LIKE' ?

2003-12-12 Thread N . A . Morgan
$keywords = str_replace(' ','%',$keywords);
select * from table where data like "%keywords%";

-Original Message-
From: Hadi [mailto:[EMAIL PROTECTED] 
Sent: 12 December 2003 13:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] anyone trickier than 'LIKE' ?


Hi all,
I have this data (eg.) "..big fat buddy..." on the database . If
a person enter "big buddy" in the search form , the "...big fat
buddy." data will not be found . Any suggestion ? Thanks in advance.


select * from table where data like "%keywords%";

-- 
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] pg_result_error()

2003-12-12 Thread Gerard Samuel
Im going to CC this to the PostgreSQL list also.

On Friday 12 December 2003 06:44 am, Martin Marques wrote:
> El Vie 12 Dic 2003 00:09, Gerard Samuel escribió:
> > What good is this function?
> > A quick example of the wall Im running into ->
> > $sql = 'INSERT INTO .';
> > $result = pg_query($conn_id, $sql);
> > if ($result === false)
> > {
> > var_dump( pg_result_error( $result ) );
>
> I would use here this:
>   die(pg_result_error( $result ));

That is fine and all, but my original example was just an example of the non 
functionality of pg_result_error(), not how to handle errors when a query 
fails.
But for arguement sake, lets use your example in some dummy code[0].
$result is still boolean false, and pg_result_error() will still return an 
empty string, and using die, would just die, with no report of what happened.
Then whats the use of pg_result_error().

> > According to the manual, pg_result_error takes the result resource.
> > If that resource is boolean false for one reason or another, then
> > pg_result_error isn't useful.
> > Anyone has any other ideas, besides using
> > pg_last_error()?
>
> Did you try it?

Yes I've tried it.  In my DB class, Im currently using both pg_result_error() 
and pg_last_error(), with pg_last_error() being secondary (a fall back) to 
pg_result_error().
Because according to the manual ->
http://us2.php.net/manual/en/function.pg-last-error.php
--quote--
Error messages may be overwritten by internal PostgreSQL(libpq) function 
calls. It may not return appropriate error message, if multiple errors are 
occured inside a PostgreSQL module function.

Use pg_result_error(), pg_result_status() and pg_connection_status() for 
better error handling.
--quote--

So again, I beg the question.
What good is pg_result_error(), when you *must* feed it boolean false and it 
returns an empty string??

[0]


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



Re: [PHP-DB] pg_result_error()

2003-12-12 Thread Martin Marques
El Vie 12 Dic 2003 11:19, Gerard Samuel escribió:
> Im going to CC this to the PostgreSQL list also.
>
> On Friday 12 December 2003 06:44 am, Martin Marques wrote:
> > El Vie 12 Dic 2003 00:09, Gerard Samuel escribió:
> > > What good is this function?
> > > A quick example of the wall Im running into ->
> > > $sql = 'INSERT INTO .';
> > > $result = pg_query($conn_id, $sql);
> > > if ($result === false)
> > > {
> > > var_dump( pg_result_error( $result ) );
> >
> > I would use here this:
> > die(pg_result_error( $result ));
>
> That is fine and all, but my original example was just an example of the
> non functionality of pg_result_error(), not how to handle errors when a
> query fails.
> But for arguement sake, lets use your example in some dummy code[0].
> $result is still boolean false, and pg_result_error() will still return an
> empty string, and using die, would just die, with no report of what
> happened. Then whats the use of pg_result_error().

Looks like you are totally right. Tried it and it works horrible. Any idea on 
why this is like this?

P.D.: I had to pass my php4 in Debian to unstable to get a workable (with the 
newer capabilities) version. Very annoing, especially becuase I had to pass 
apache to unstable as well. :-(

--
 12:13:01 up 16 days, 18:29,  3 users,  load average: 1.32, 0.90, 0.67
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

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



[PHP-DB] MSSQL Error message

2003-12-12 Thread Liana Cristine Leopold

 
Hi

I´m using a connection using php 4.3.3 with sql server  ... and i´m having a error 
message :
mssql error: [: Connection error to server '192.0.0.6\binotto' with user 'LUA']  ..

The user 'LUA' is the dbowner ...

anyone can help me???

Sorry my bad english ...

Liana Cristine Leopold

RE: [PHP-DB] Cronjob

2003-12-12 Thread Daevid Vincent
One thing I might suggest is to queue up your inserts, then use the extended
insert syntax to populate several records at once in a single INSERT instead
of 12 separate ones. I believe you can alter the /etc/my.cnf file to play
more 'nice' as far as priorities and memory, but I've never touched it
  

> -Original Message-
> From: Ryan Marks [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, December 11, 2003 6:45 PM
> To: PHP-DB
> Subject: [PHP-DB] Cronjob
> 
> Hello all,
> 
> I have a cronjob that runs a PHP script against MySQL.  The 
> script takes 5
> minutes to process 4000 records (approximately 12 records per 
> second).  Here
> are the top two entries from top:
>   PID USER PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME 
> CPU COMMAND
>  8671 mysql 25   0 20172  19M  2000 R97.8  3.9   2:02 
>   0 mysqld
>  8670 appmgr15   0  2088 2088  1424 S 2.2  0.4   0:03   0 php
> 
> Is there a way that I can slow down the script so mysqld does 
> not bog the
> machine down.
> 
> Here is a snippet of code.  The function is called by the cronjob.
> 
> function rank_mailbox_current($company_ID){
>   $query = "select app_ID from mailbox where company_ID = 
> \"$company_ID\"
>   and deleted_date = 0 order by mailbox.ID desc";
>   $result=query_database($query);
> 
>   while ($row = mysql_fetch_assoc($result)){
>   $app_ID = $row["app_ID"];
>   $rank_of_app=rank_app($app_ID,$company_ID);
>   }
> }
> 
> 
> Server: P-IV 2.4GHz, 512 DDRAM, RedHat 9
> PHP Version 4.3.1
> MySQL 4.0.3
> 
> Thanks,
> Ryan
> 
> -- 
> 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] Re: [PHP] [PHP-DB] pg_result_error()

2003-12-12 Thread Gerard Samuel
On Friday 12 December 2003 10:24 am, Martin Marques wrote:
> > That is fine and all, but my original example was just an example of the
> > non functionality of pg_result_error(), not how to handle errors when a
> > query fails.
> > But for arguement sake, lets use your example in some dummy code[0].
> > $result is still boolean false, and pg_result_error() will still return
> > an empty string, and using die, would just die, with no report of what
> > happened. Then whats the use of pg_result_error().
>
> Looks like you are totally right. Tried it and it works horrible. Any idea
> on why this is like this?
>

Seems like Im not the only one who thought this function is useless...
http://bugs.php.net/bug.php?id=18747
So Im going to modify my code to not use this function, as it is really a 
total waste of time at the moment.
Thanks for the chat...

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