[PHP-DB] Wrapper classes

2003-07-21 Thread Mohammad Saad
Hello all,
I would like to know what is the best wrapper class for Mysql database interface. I 
need a kind of class which will return me results of query in an array and take care 
of all the cleaning of resources

Thanks all
Mohammad Saad


Re: [PHP-DB] Weird PHP behavior...

2003-02-06 Thread Mohammad Saad
Check path on this require
require_once(/www/DW/prod.lib.php);
something is wrong with this
- Original Message -
From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, February 06, 2003 10:17 PM
Subject: RE: [PHP-DB] Weird PHP behavior...


 Here is the working code...

 ?php
  require_once(/www/DW/prod.lib.php);
  $hr = date(G);
  if ($hr  7) {
   $sql = mysql(Calendar2,SELECT B.Title, UNIX_TIMESTAMP(A.StartDate),
 UNIX_TIMESTAMP(A.StopDate) FROM  `phpCalendar_Details`  AS B,
 `phpCalendar_Daily`  AS A WHERE A.CalendarDetailsID = B.CalendarDetailsID
 AND CURDATE()  BETWEEN A.StartDate AND A.StopDate) or die(mysql_error());
   $mid = mktime (0,0,0,date(m)  ,date(d)+1,date(Y));
  } else {
   $sql = mysql(Calendar2,SELECT B.Title, UNIX_TIMESTAMP(A.StartDate),
 UNIX_TIMESTAMP(A.StopDate) FROM  `phpCalendar_Details`  AS B,
 `phpCalendar_Daily`  AS A WHERE A.CalendarDetailsID = B.CalendarDetailsID
 AND CURDATE()-2  BETWEEN A.StartDate AND A.StopDate) or
die(mysql_error());
   $sql2 = mysql(Calendar2,SELECT B.Title FROM  `phpCalendar_Details`
AS
 B,  `phpCalendar_Daily`  AS A WHERE A.CalendarDetailsID =
 B.CalendarDetailsID AND CURDATE()  BETWEEN A.StartDate AND A.StopDate) or
 die(mysql_error());
   $res2 = mysql_fetch_row($sql2);
   $new = $res2[0];
   $mid = mktime (0,0,0,date(m)  ,date(d)-2,date(Y));
  }
  $res = mysql_fetch_row($sql);
  $sa = $res[0];
  $start = $res[1];
  $stop = $res[2];
  $day1 = date(l, $start);
  $date1 = date(jS, $start);
  $month1 = date(F, $start);
  $day3 = date(l, $stop);
  $date3 = date(jS, $stop);
  $month3 = date(F, $stop);
  if ($day1 == Friday) {
   $day2 = date(l, $mid);
   $date2 = date(jS, $mid);
   $month2 = date(F, $mid);
   if ($month1 != $month2) {
$line2 = $month1 $date1, $month2 $date2 and $date3;
   } elseif ($month2 != $month3) {
$line2 = $month1 $date1 and $date2, and $month3 $date3;
   } else {
$line2 = $month1 $date1, $date2, and $date3;
   }
   $line1 = ONCALL SA for Friday, Saturday, and Sunday;
  } else {
   if ($month1 != $month3) {
$line2 = $month1 $date1 and $date3;
   } else {
$line2 = $month1 $date1 and $month3 $date3;
   }
   $line1 = ONCALL SA for $day1 and $day3;
  }

  mysql_select_db($database, $Prod);
  $query = SELECT name, pager FROM contacts_sa WHERE sbcuid='$sa';
  $said = mysql_query($query, $Prod) or die(mysql_error());
  $row = mysql_fetch_row($said);
  $name = $row[0];
  $pager = $row[1];

  if ($date3 == date(jS, $stop)  $hr  8) {
   $query2 = SELECT name FROM contacts_sa WHERE sbcuid='$new';
   $said2 = mysql_query($query2, $Prod) or die(mysql_error());
   $row2 = mysql_fetch_row($said2);
   $name2 = $row2[0];
   $line4 = Please be aware the On-Call turnover occurs at 8AM.  brThe
 oncoming SA after 8AM will be $name2.;
  } else {
   $line4 = $name begins On-Call at 8AM on $day1.;
  }
 ?
 html
 head
 titleUntitled Document/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head

 body
   h2 align=centerspan lang=en-usCALL 214-741-6961 br
   FOR CURRENT ONCALL STATUS./span/h2
   hr color=#6363C9 size=3 width=50%
   p align=center?php echo $line1; ?br
   /span(span lang=en-us?php echo $line2; ?/span) br
   span lang=en-us?php echo $name; ? /span(pager span
 lang=en-us
   ?php echo $pager; ?)br
   ?php echo $line4; ?/span/p
   hr color=#6363C9 size=3 width=50%
 /body
 /html

 The portion of PHP code prior to the HTML is inserted at the top of
the
 file in the broken page.  Here is how the HTML portion of the PHP is
 inserted...

 snip...
   td background=images/bg_leftside.gif width=20nbsp;/td
   td width=20 background=images/bg_main.gifnbsp;/td
   td width=550 background=images/bg_main.gif valign=top
   p align=left dynamicanimation=fpAnimOutflyBottomRightFP1
 id=fpAnimOu
 tflyBottomRightFP1 style=position: relative !important
 onclick=dynAnimOut(th
 is) language=Javascript1.2nbsp;/p
  h2 align=centerspan lang=en-usCALL 214-741-6961 br
  FOR CURRENT ONCALL STATUS./span/h2
  hr color=#6363C9 size=3 width=50%
  p align=center?php echo $line1; ?br
  /span(span lang=en-us?php echo $line2; ?/span) br
  span lang=en-us?php echo $name; ? /span(pager span
 lang=en-us
 
  ?php echo $pager; ?)br
  ?php echo $line4; ?/span/p
  hr color=#6363C9 size=3 width=50%
   h4 align=centerspan lang=en-usFor escalation procedures,
   a href=on-call/escalation.htmclick here./a/span/h4
   h4 align=centerspan lang=en-usFor restore requests call the
 Help

   Desk/span/h4

 ...snip

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 06, 2003 11:09 AM
 To: NIPP, SCOTT V (SBCSI)
 Subject: RE: [PHP-DB] Weird PHP behavior...



 well show the working code and then show just a portion of the code that
is
 broken specifically where you are trying to inslucde the working 

[PHP-DB] Best reporting Tool

2002-11-13 Thread Mohammad Saad
Hi, I wanted to ask a question, Whats the best way of developing reports in
PHP. I mean in case of ASP, developers use Crystal Reports but apparently
PHP doesn't support Crystal Reports. so is there any other tool for me? or
should I use conventional method of writing database queries, PHP paging and
HTML table formatting to generate reports. The reason I am asking is this,
that for a particular project I need to come up with around 175 reports,
Although am sure some of the reports formats will be the same so I can just
switch queries in those. but still is there any other better way out, are
Oracle Reports supported in PHP?

Thanks in Advance
Saad


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




Re: [PHP-DB] Am I doing This Right?

2002-11-01 Thread Mohammad Saad
check the values of these variables

$rTemp = $HTTP_POST_FILES['replay_file']['tmp_name'];
$rName = $HTTP_POST_FILES['replay_file']['name'];
$rSize = $HTTP_POST_FILES['replay_file']['size'];

// Define Replay Upload DIR and FILE name
$rFile = $db_nextid._.$HTTP_POST_FILES['replay_file']['name'];
$rLoc = files/war3-replays/$rFile;

they should contain some value , one more thing , mite be the case that
$HTTP_POST_FILES['replay_file']['tmp_name'] should be
$HTTP_POST_FILES['REPLAY_FILE']['TMP_NAME]

do one thing, print_r($HTTP_POST_FILES); this should show you what that
array contains
Good Luck

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 01, 2002 2:45 PM
Subject: Re: [PHP-DB] Am I doing This Right?



After I submit the file, it goes back to the form, even though in
the
 script, it says to go to the database and move the uploaded file to a new
 DIR.

It ignores it as if the file wasn't uploaded.

As for printing out the variables. All my important variables are
 $HTTP_POST_FILES and those are all null.



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




[PHP-DB] Bindbyname error in solaris

2002-03-06 Thread Mohammad Saad

Hello
I have PHP4.10 on solaris with oci8 support. everything seems to work 
well. Oracle support is working fine. but I am getting an error when I 
am trying OCIBindByName to bind a variable to an out variable of a 
stored procedure. 
I have checked this code on php4.10 on windows 2k with same database 
and it works well. I get the value of the out variable in my binded 
variable of PHP script.
.Only PHP on solaris is giving me the error, any ideas why? here is the 
code and the error

$getcardvalidity = begin customer.scratch_check
('$serial','$code1','$code2',:amount);end;; 
$cardstmt = OCIParse($conn,$getcardvalidity);
OCIBindByName ( $cardstmt, :amount, $amount,4);
OCIExecute($cardstmt,OCI_DEFAULT);

Warning: OCIStmtExecute: Error while trying to retrieve text for error 
ORA-03113 

and this code works well when i run same script on php installed on 
win2k but i have to make it run on solaris.
Thanks in advance 
Saad


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