Re: [PHP-DB] Issue with date() function...

2005-06-10 Thread Chase
I made that modification and now it doesn't update the DB at all...

Here is the code that I am using to insert that variable into my MySQL DB... 
Again, my variable is defined as $rec2day = date("Y-m-d") OR $rec2day = 
date("Y/m/d")











"Bruno Ferreira" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Chase wrote:
>
>>I have a variable:
>>$rec2day = date("Y-m-d");
>>that displays correctly when echoed to the screen, but when I write it to 
>>my DB, I get the mathmatical answer to the equasion (1989 (2005-06-10)).
>>
>>What do I need to do to correct this??
>>
>Just use $rec2day= date("Y/m/d");
>
>You database system doesn't like using "-" as a separator in dates, 
> thus thinking it's a minus sign and doing the appropriate math. Just use 
> slashes and you'll probably be OK.
>
>-- Bruno Ferreira
> ---
> [This E-mail scanned for viruses by Declude Virus] 

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



[PHP-DB] Issue with date() function...

2005-06-10 Thread Chase
I have a variable:
$rec2day = date("Y-m-d");
that displays correctly when echoed to the screen, but when I write it to my 
DB, I get the mathmatical answer to the equasion (1989 (2005-06-10)).

What do I need to do to correct this??

TIA 

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



[PHP-DB] User Auth and More...

2005-06-07 Thread Chase
Good Day!
  I am trying to create a page that will start off asking for a username and 
password, verify the entry against a MySQL database, and depending on what 
the "access level" is in the table, so one of five or six files on a page 
for downloading.

  I have the login script working for another purpose, but I can't seem to 
get it to work for me here.

  Any thoughts on a direction I should go?

Thanks! 

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



Re: [PHP-DB] URL Problem

2004-04-21 Thread C Daniel Chase
Lambert, Patrick wrote:
So it sounds like you need to examine the headers of the response (which
sounds like it is a redirect)?
Try PEAR's HTTP_Request (http://pear.php.net/package/HTTP_Request).
This time in PHP using the above:

Array
(
[response_code] => 302
[response] => HTTP/1.1 302 Found
[Date] => Wed, 21 Apr 2004 18:50:25 GMT
[Server] => Apache
[Location] => http://www.utc.edu/Administration/Records-Registration/
[Connection] => close
[Content-Type] => text/html; charset=iso-8859-1
)

So you will be able to access the Redirect with a nice associative 
array... Enjoy!

-Dan
--
C. Daniel Chase[EMAIL PROTECTED]
Web Development Specialist(423) 425-4009
The University of Tennessee at Chattanooga   http://www.utc.edu/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] URL Problem

2004-04-21 Thread C Daniel Chase
Lambert, Patrick wrote:
So it sounds like you need to examine the headers of the response (which
sounds like it is a redirect)?
Try PEAR's HTTP_Request (http://pear.php.net/package/HTTP_Request).
More specifically, you need a HEAD request:
http://pear.php.net/manual/en/package.http.http.head.php
For a Redirect, you should get something like this HEAD request (Perl,
lwp-request):
$ HEAD -S http://www.utc.edu/~recreg/
HEAD http://www.utc.edu/~recreg/ --> 302 Found
HEAD http://www.utc.edu/Administration/Records-Registration/ --> 200 OK
Connection: close
Date: Wed, 21 Apr 2004 18:37:36 GMT
Accept-Ranges: bytes
ETag: "8b7fe3-444f-40869730"
Server: Apache/1.3.20a (NETWARE) mod_jk/1.1.0
Content-Language: en
Content-Type: text/html; charset=ISO-8859-1
Last-Modified: Wed, 21 Apr 2004 15:45:52 GMT
Client-Date: Wed, 21 Apr 2004 18:38:13 GMT
Client-Peer: 192.168.128.10:80
Client-Response-Num: 1
You will have to extract the Redirect part...

-Dan
--
C. Daniel Chase[EMAIL PROTECTED]
Web Development Specialist(423) 425-4009
The University of Tennessee at Chattanooga   http://www.utc.edu/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Code problem - need help.

2003-01-12 Thread Chase Urich
> When I view on my web page, the $number value comes out fine, but the $name
> comes out as "Resource ID #x" where x is some number. Currently is says
> "Resource ID #6". I know the SQL syntax is right, I have tested it. But what
> is wrong here?

The mysql_query command returns a result set, not the 'value' of the
query. Look up the mysql_fetch_array
[http://us2.php.net/manual/en/function.mysql-fetch-array.php] and
mysql_fetch_row commands. There are also several variants of these that
return slightly different formats.

Chase


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




Re: [PHP-DB] Re: PHP/MySQL not available remotely...

2002-12-04 Thread Chase
The phpinfo() call works great on the server itself, but I cannot get the
information to display to anyone that connects to the server.


"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Thursday 05 December 2002 00:44, Chase wrote:
> > Yes I am.
> >
> > I was just asked to create a simple web page that would display the
> > visitors IP address using:
> >
> > 
>
> So you're saying that the above works ...
>
> > and when I call this up over the intranet or internet it works just
fine.
> > However, I was also asked to create a page that would just display the
PHP
> > Info screen and that will only show up on the server..  I can't get that
> > page to show remotely.
>
> ... but  doesn't work??
>
> > Based on this, I think my error is in my setups for either PHP4 or
IIS...
>
> If phpinfo() doesn't work then I think you've got far bigger problems than
> setups to worry about ;-)
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
>
> /*
> I knew one thing: as soon as anyone said you didn't need a gun, you'd
better
> take one along that worked.
> -- Raymond Chandler
> */
>



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




Re: [PHP-DB] Re: PHP/MySQL not available remotely...

2002-12-04 Thread Chase
Yes I am.

I was just asked to create a simple web page that would display the visitors
IP address using:



and when I call this up over the intranet or internet it works just fine.
However, I was also asked to create a page that would just display the PHP
Info screen and that will only show up on the server..  I can't get that
page to show remotely.

Based on this, I think my error is in my setups for either PHP4 or IIS...


"David Smith" <[EMAIL PROTECTED]> wrote in message
1039019556.7619.3.camel@hemlock">news:1039019556.7619.3.camel@hemlock...
> Are you able to connect to the MySQL server from the command line using
> a non-php client?
>
> --Dave
>
> On Wed, 2002-12-04 at 09:04, [EMAIL PROTECTED] wrote:
> >
> > do you have the persmissions set either for
[EMAIL PROTECTED](which
> > would only work from remotehost.com) or username@'%' (which would work
for
> > that username from any host)
> >
> >
> > hth
> > jeff
> >
> >
> >
> > "Chase"
> >  > biz> cc:
> >  Subject: [PHP-DB] Re:
PHP/MySQL not available remotely...
> > 12/04/2002
> > 10:58 AM
> >
> >

> >
> >
> >
> >
> > Okay, it was suggested that I may not have my "register_globals" flagged
to
> > "on" but I do.  I still can't seem to make any remote connect to the
> > server.
> > Again, there are no errors, it just flat don't work.
> >
> > Chase
> >
> >
> > "Chase" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I seem to have a bit of an issue with my PHP/MySQL settings...
> > >
> > > A basic PHP bit like  works great on my
> > > webserver.  However, with any form of DB access the page just hangs...
I
> > > don't get an error, but I don't get results either.  I also have
> > > phpMyAdmin-2.3.3 running.  I can access that from the server directly,
> > but
> > > if I try to get to it via any other machine I get NO results.
> > >
> > > I am running IIS 5 with PHP4 and MySQL v3.23.53-max.
> > >
> > > Suggestions?
> > >
> > >
> >
> >
> >
> > --
> > 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] Re: PHP/MySQL not available remotely...

2002-12-04 Thread Chase
Okay, it was suggested that I may not have my "register_globals" flagged to
"on" but I do.  I still can't seem to make any remote connect to the server.
Again, there are no errors, it just flat don't work.

Chase


"Chase" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I seem to have a bit of an issue with my PHP/MySQL settings...
>
> A basic PHP bit like  works great on my
> webserver.  However, with any form of DB access the page just hangs... I
> don't get an error, but I don't get results either.  I also have
> phpMyAdmin-2.3.3 running.  I can access that from the server directly, but
> if I try to get to it via any other machine I get NO results.
>
> I am running IIS 5 with PHP4 and MySQL v3.23.53-max.
>
> Suggestions?
>
>



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




[PHP-DB] PHP/MySQL not available remotely...

2002-12-03 Thread Chase
I seem to have a bit of an issue with my PHP/MySQL settings...

A basic PHP bit like  works great on my
webserver.  However, with any form of DB access the page just hangs... I
don't get an error, but I don't get results either.  I also have
phpMyAdmin-2.3.3 running.  I can access that from the server directly, but
if I try to get to it via any other machine I get NO results.

I am running IIS 5 with PHP4 and MySQL v3.23.53-max.

Suggestions?



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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Chase
Thank you!!  This appears to have solved it...  I didn't even think of using
the "$message" variable instead of the "print()"...  Sheesh...  I still have
LOTS to learn!!

Chase


"Micah Stevens" <[EMAIL PROTECTED]> wrote in message
1038878012.23696.129.camel@tyrell">news:1038878012.23696.129.camel@tyrell...
> Remember, the print() function sends stuff to the browser. If you wish
> to make the code output to the $message variable, you must use
> additional assignment statements.
>
> I made some quick changes to the code below, try that:
>
>  $server = "";
> $user = "";
> $pass = "";
> $db = "";
> $table = "";
> ?>
>
>  $to  = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> $to .= "Chase <[EMAIL PROTECTED]>";
>
> $subject = "Price File Access History";
>
> $message = '
> 
> Price File Access
>
> 
> 
> 
> 
>   Date / Time
> 
> 
>   Logged IP Address
> 
> 
>   Logged Username
> 
> 
> ';
>
> $link = mysql_connect("$server", "$user", "$pass");
> mysql_select_db("$db", $link);
>
> $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> DESC",$link);
> $num_rows = mysql_num_rows($result);
>
> if($num_rows) {
> //   print("");
>while($row = mysql_fetch_row($result))
>
>{
>
>   $message .= "";
>   $message .= "$row[0]";
>   $message .= "$row[1]";
>   $message .= "$row[2]";
>   $message .= "";
>
>
>}
>$message .= "";
>  } else {
>$message .= "No Files To Show!!";
>
>  }
> $message .= "
> 
> ";
>
> $headers  = "MIME-Version: 1.0\r\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
>
> $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";
>
> mail($to, $subject, $message, $headers);
>
> ?>
>
>
>
> On Mon, 2002-12-02 at 16:30, Chase wrote:
> >   There is a single quote and semicolon on the line under  that I
> > thought would be defining the end of the assignment.
> >   Should I have used double quotes instead of single?
> >
> > Chase
> >
> >
> > "Micah Stevens" <[EMAIL PROTECTED]> wrote in message
> > 1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
> > > There aren't any closing quotes on your $message variable or semicolon
> > > to tell the parser that you're done with the assignment statement.
> > >
> > > -Micah
> > >
> > >
> > >
> > >
> > >
> > > On Mon, 2002-12-02 at 15:05, Chase wrote:
> > > > When trying to execute the following script to send the contents of
a
> > table
> > > > via "mail()" I am getting this error...
> > > >
> > > > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on
line 36
> > > >
> > > > The portion of this code inside the HTML tags works great for
displaying
> > the
> > > > table on the screen, but when I include it in the larger script for
> > sending
> > > > a mail message, I get this error.
> > > >
> > > > I am sure that it is something simple that I have been too stupid to
> > catch,
> > > > but any help would be great!
> > > >
> > > > Chase
> > > >
> > > >
> > > > Code Follows  --->
> > > >
> > > >  > > > $server = "";
> > > > $user = "";
> > > > $pass = "";
> > > > $db = "";
> > > > $table = "";
> > > > ?>
> > > >
> > > >  > > > $to  = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> > > > $to .= "Chase <[EMAIL PROTECTED]>";
> > > >
> > > > $subject = "Price File Access History";
> > > >
> > > > $message = '
> > > > 
> > > > Price File Access
> > > >
> > > > 
> > > > 
> > > > 
> > > > 
> > > >   Date / Time
> > > > 
> > > > 
> > > >   Logged IP Address
> > &g

Re: [PHP-DB] Parse Error...

2002-12-02 Thread Chase
  Okay, you just jumped WAY outside my basic knowledge...  However, it does
make perfect sense, so I am off to the library...

Chase


"Jim Hunter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
In that case, your logic is not going to work. You have live PHP code inside
a string. You are going to need to build the $message in pieces. Start with
the HTML, then add the result from each itteration of your PHP loop to
$message then add the trailing HTML to form the complete $message.

Your close, but it's just not going to work like you think it will.

Jim


---Original Message---

From: Chase
Date: Monday, December 02, 2002 04:34:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Parse Error...

There is a single quote and semicolon on the line under  that I
thought would be defining the end of the assignment.
Should I have used double quotes instead of single?

Chase


"Micah Stevens" <[EMAIL PROTECTED]> wrote in message
1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
> There aren't any closing quotes on your $message variable or semicolon
> to tell the parser that you're done with the assignment statement.
>
> -Micah
>
>
>
>
>
> On Mon, 2002-12-02 at 15:05, Chase wrote:
> > When trying to execute the following script to send the contents of a
table
> > via "mail()" I am getting this error...
> >
> > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
> >
> > The portion of this code inside the HTML tags works great for displaying
the
> > table on the screen, but when I include it in the larger script for
sending
> > a mail message, I get this error.
> >
> > I am sure that it is something simple that I have been too stupid to
catch,
> > but any help would be great!
> >
> > Chase
> >
> >
> > Code Follows --->
> >
> >  > $server = "";
> > $user = "";
> > $pass = "";
> > $db = "";
> > $table = "";
> > ?>
> >
> >  > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> > $to .= "Chase <[EMAIL PROTECTED]>";
> >
> > $subject = "Price File Access History";
> >
> > $message = '
> > 
> > Price File Access
> >
> > 
> > 
> > 
> > 
> > Date / Time
> > 
> > 
> > Logged IP Address
> > 
> > 
> > Logged Username
> > 
> > 
> >
> > $link = mysql_connect("$server", "$user", "$pass");
> > mysql_select_db("$db", $link);
> >
> > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> > DESC",$link);
> > $num_rows = mysql_num_rows($result);
> >
> > if($num_rows) {
> > // print("");
> > while($row = mysql_fetch_row($result))
> >
> > {
> >
> > print("");
> > print("$row[0]");
> > print("$row[1]");
> > print("$row[2]");
> > print("");
> >
> >
> > }
> > print("");
> > } else {
> > print("No Files To Show!!");
> >
> > }
> >
> > 
> > 
> > ';
> >
> > $headers = "MIME-Version: 1.0\r\n";
> > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> >
> > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";
> >
> > mail($to, $subject, $message, $headers);
> >
> > ?>
> >
> --
> 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

.



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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Chase
  There is a single quote and semicolon on the line under  that I
thought would be defining the end of the assignment.
  Should I have used double quotes instead of single?

Chase


"Micah Stevens" <[EMAIL PROTECTED]> wrote in message
1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
> There aren't any closing quotes on your $message variable or semicolon
> to tell the parser that you're done with the assignment statement.
>
> -Micah
>
>
>
>
>
> On Mon, 2002-12-02 at 15:05, Chase wrote:
> > When trying to execute the following script to send the contents of a
table
> > via "mail()" I am getting this error...
> >
> > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
> >
> > The portion of this code inside the HTML tags works great for displaying
the
> > table on the screen, but when I include it in the larger script for
sending
> > a mail message, I get this error.
> >
> > I am sure that it is something simple that I have been too stupid to
catch,
> > but any help would be great!
> >
> > Chase
> >
> >
> > Code Follows  --->
> >
> >  > $server = "";
> > $user = "";
> > $pass = "";
> > $db = "";
> > $table = "";
> > ?>
> >
> >  > $to  = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> > $to .= "Chase <[EMAIL PROTECTED]>";
> >
> > $subject = "Price File Access History";
> >
> > $message = '
> > 
> > Price File Access
> >
> > 
> > 
> > 
> > 
> >   Date / Time
> > 
> > 
> >   Logged IP Address
> > 
> > 
> >   Logged Username
> > 
> > 
> >
> > $link = mysql_connect("$server", "$user", "$pass");
> > mysql_select_db("$db", $link);
> >
> > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> > DESC",$link);
> > $num_rows = mysql_num_rows($result);
> >
> > if($num_rows) {
> > //   print("");
> >while($row = mysql_fetch_row($result))
> >
> >{
> >
> >   print("");
> >   print("$row[0]");
> >   print("$row[1]");
> >   print("$row[2]");
> >   print("");
> >
> >
> >}
> >print("");
> >  } else {
> >print("No Files To Show!!");
> >
> >  }
> >
> > 
> > 
> > ';
> >
> > $headers  = "MIME-Version: 1.0\r\n";
> > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> >
> > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";
> >
> > mail($to, $subject, $message, $headers);
> >
> > ?>
> >
> --
> 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




[PHP-DB] Parse Error...

2002-12-02 Thread Chase
When trying to execute the following script to send the contents of a table
via "mail()" I am getting this error...

Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36

The portion of this code inside the HTML tags works great for displaying the
table on the screen, but when I include it in the larger script for sending
a mail message, I get this error.

I am sure that it is something simple that I have been too stupid to catch,
but any help would be great!

Chase


Code Follows  --->



" . ", " ;
$to .= "Chase <[EMAIL PROTECTED]>";

$subject = "Price File Access History";

$message = '

Price File Access





  Date / Time


  Logged IP Address


  Logged Username



$link = mysql_connect("$server", "$user", "$pass");
mysql_select_db("$db", $link);

$result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
DESC",$link);
$num_rows = mysql_num_rows($result);

if($num_rows) {
//   print("");
   while($row = mysql_fetch_row($result))

   {

  print("");
  print("$row[0]");
  print("$row[1]");
  print("$row[2]");
  print("");


   }
   print("");
 } else {
   print("No Files To Show!!");

 }



';

$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";

mail($to, $subject, $message, $headers);

?>




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




[PHP-DB] Help In Colorado??

2002-11-23 Thread Chase
Is there anyone in the Denver / Aurora area that might be willing to help me
out a bit??

I am working on a very small project that could lead to something much
bigger, but I am not sure how to go about getting started.  The big picture
is that I want to sell various products on my website, allowing for
customization, and then be able to provide updated totals followed by either
sending me an email with all of the information, or passing the information
over to an e-commerce site such as "PayPal" for checkout.

I think I have a good foundation, but I can't seem to ask my questions in
such a way to get a useable answer.

Please reply privately...

Chase
[EMAIL PROTECTED]



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




Re: [PHP-DB] Variable won't be passed from HTTP address bar

2002-10-18 Thread Chase Urich
Check your register_globals setting in your php.ini file. This used to
default to 'yes', but now defaults to 'no'.


On Fri, 2002-10-18 at 06:26, Michel Bakkenes - bakkenes.net wrote:
> Ok.. I'm not a newbie I thought.. I do have experience with PHP, but I
> never suffered from this error.
>  
> I used on my own redhat 8.0 server the following test-script:
>  
> if($action=="test"){ echo "Test";}
>  
> I tried it to run with: 127.0.0.1/index.php?action=test
>  
> It doesn't print anything. (which means I even can't print hello world
> :P)
>  
> Oh, other variable constructions like $bla = "blah" . echo $bla etc. do
> work.. 
>  
> With regards,
>  
> Michel Bakkenes
> J2ee developer
>  
> Infolook BV
> Zevenbergen, The Netherlands
-- 
Linux: Because rebooting is for adding hardware.
Fingerprint = CE24 057D 1E88 A253 3196 89DB 9FF0 9EF0 2F70 8BE8 BE8



signature.asc
Description: This is a digitally signed message part


[PHP-DB] Multiple Sorts??

2002-09-10 Thread Chase

Is there a way that I can sort data twice when it is being pulled from the
DB?  Here is a sample line of my code:

$result = mysql_query("SELECT * FROM pfiles WHERE cdate >= '2002-07-01'
ORDER BY 'cdate' DESC", $link);

I would like to be able to sort this data FIRST by 'cdate' then by 'vendor'
Is this possible?


Thanks!
Chase



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




Re: [PHP-DB] SELECTing a date range from a table

2002-08-04 Thread Chase Knott

Oh sure...  Use logic!!!

   I am using a MySQL database that has 4 columns, right now, they are 
all set to VARCHAR since I was getting errors trying to make them date 
fields.  The column names are "vendor," "edate," "cdate," and "fname." 
I want to pull all entries in the database where "cdate" is either 
between a certain range, or is greater than or equal to a specified date.

   Any help would be great!!!

Jason Wong wrote:

> On Sunday 04 August 2002 11:33, Chase Knott wrote:
> 
>>I am a newbie.  There, I said it!  *gryn*
>>
>>Maybe someone here can help me out...  I am trying to figure out how to
>>select a range of dates from my table to be used in a dynamic page.  I
>>know it is something simple, but I just can't seem to find anything.
>>Any help would be great.  Thanks!!
>>
> 
> Knowing what you're using would be helpful -- MySQL? Access? MS-Sql? Also 
> knowing what your table looks like, specifically the datatype of the 
> column(s) which holds your date info, would also be very helpful.
> 
> 


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




[PHP-DB] SELECTing a date range from a table

2002-08-03 Thread Chase Knott

I am a newbie.  There, I said it!  *gryn*

Maybe someone here can help me out...  I am trying to figure out how to 
select a range of dates from my table to be used in a dynamic page.  I 
know it is something simple, but I just can't seem to find anything. 
Any help would be great.  Thanks!!

Chase


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




Re: [PHP-DB] Excel to MySQL??

2002-06-29 Thread Chase

My webhost is running phpMyAdmin v2.2.2 and it is giving me errors when 
I try to load the file.  Are there any certain characters that cannot be 
in the file?  (ie. "$")

Chase

Peter Lovatt wrote:

> Hi
> 
> from Excel export to csv
> 
> use phpMyAdmin to load it into mysql (recent versions of phpMyAdmin has an
> Excel import function)
> 
> HTH
> 
> Peter
> 
> ---
> Excellence in internet and open source software
> ---
> Sunmaia
> www.sunmaia.net
> [EMAIL PROTECTED]
> tel. 0121-242-1473
> ---
> 
> 
>>-Original Message-
>>From: Chase [mailto:[EMAIL PROTECTED]]
>>Sent: 29 June 2002 22:22
>>To: [EMAIL PROTECTED]
>>Subject: [PHP-DB] Excel to MySQL??
>>
>>
>>Does anyone know of a way that I can export an Excel spreadsheet to a
>>file that I can import to MySQL?  I found a program that will do this
>>for Access, but I would rather leave Access out of this if possible.
>>Thanks!!
>>
>>Chase
>>
>>
>>--
>>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] Excel to MySQL??

2002-06-29 Thread Chase

Does anyone know of a way that I can export an Excel spreadsheet to a 
file that I can import to MySQL?  I found a program that will do this 
for Access, but I would rather leave Access out of this if possible. 
Thanks!!

Chase


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




[PHP-DB] RE: Images on MySQL

2002-03-29 Thread Andrew Chase

The kneejerk response always seems to be #2, store images in the filesystem
and store their paths in the database.

I like to compromise: store the original image in a dedicated "image data"
table in the database (keep a separate table for image meta data
(date/title/category/whatever) for faster queries, link the two with an
'image_id' field), then have the script which displays the image check for a
copy in a specified directory in the filesystem; if it's not there, yank a
copy from the database, resize/watermark as needed, and store in the
directory.  Otherwise, the script can just write the img href on the fly.

This way you don't wind up with the overhead of pulling images from the DB
on the fly every time (just the first time a script looks for the image),
but you maintain a pristine copy of the original image in the database-
especially nice for uploading photos straight out of a digital camera
without monkeying around in Photoshop/GIMP; you get the web-sized copy in
your /images directory, but you keep the full resolution copy in the db if
you ever need it for something else.  And if you ever need to move the db to
a new server, you don't need to worry about moving all the image files
separately.

I suppose storage space might become a factor if the number of images
climbed into the high hundreds or thousands, but it works great for me in
smaller applications.  YMMV, caveat emptor, etc.

-Andy

> -Original Message-
> From: Clever [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 28, 2002 3:35 AM
> To: [EMAIL PROTECTED]
> Subject: Images on MySQL
>
>
> Hi,
> I'm designing a site and I have to store a lot of images.
> Which is the best for speed?
> 1) Store all images on a MySQL table?
> 2) Save them on disk like normal files and only have pointers to
> them on the
> database?
> Thanks a lot
> Clever Anjos
>
>
>


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




[PHP-DB] RE: Creating a good search engine

2002-03-25 Thread Andrew Chase

You might want to check out this article on Webmonkey:

http://hotwired.lycos.com/webmonkey/97/16/index2a.html?tw=programming

The article uses Perl, but the concepts are easy enough to translate to PHP.
:)

-Andy

> -Original Message-
> From: Mike de Libero [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 6:54 AM
> To: [EMAIL PROTECTED]
> Subject: Creating a good search engine
>
>
> Hi Guys,
>
> I need to create a search engine that catalogs data from
> about 4 separate tables, and then of course is searchable from
> use input.  I'm having a brain fart on how I should go about
> doing this.  This is what I think I should do so far tell me if
> I'm right or at least going in the right direction.


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




RE: [PHP-DB] RE: Search results

2002-02-06 Thread Andrew Chase

Yes, sorry about that. :P  I need to eat lunch now.

-Andy

> -Original Message-
> From: Chris Boget 
> Subject: Re: [PHP-DB] RE: Search results

> you mean:
> 
> mysql_num_rows();
> 


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




[PHP-DB] RE: Search results

2002-02-06 Thread Andrew Chase

You can use mysql_result_rows() to check whether any rows were returned;
something like:

 0){

while ($row = mysql_fetch_array($result)) {

//Do stuff with result rows here

}

}else{

echo "Sorry your search returned Zero Rows";

}

?>

HTH,

-Andy

> -Original Message-
> From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 06, 2002 10:17 AM
> To: [EMAIL PROTECTED]
> Subject: Search results
>
>
> I have done a search page based on a specific column name, but in some
> columns there is no results to be returned..
>
> What I would like to do is display an error message stating that
> there is no
> results .. something like "Sorry your search returned Zero Rows"
>


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




[PHP-DB] RE: Creating a pdf document

2002-01-24 Thread Andrew Chase

http://www.php.net/pdf

You'll need Thomas Mertz' PDFlib, which is free for personal/not-for-profit
use, but requires a license fee for commercial use:

http://www.pdflib.com/pdflib/index.html


-Andy

> -Original Message-
> From: Mihail Bota [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 11:53 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Creating a pdf document

> I was wondering if I could save the result of a query in a pdf document. I
> looked for any functions that might help, but I got confused because I
> could not see how/where exactly to insert the necessary .dll's. I'd like
> to do this (saving the output of a query) by using mysql installed on a
> Irix machine, and PHP4.
> If this is not possible, could I create a pdf document or a word document
> from a query from either Access database or mysql on a win2k system,
> PHP4.1?
> Any references that might help?
> Thanks for your help!


-- 
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: display text in screen

2002-01-11 Thread Andrew Chase

Just add echo statments at whatever steps you want to display comment or
detail for; something like:



Some page

";
echo mysql_error();
echo "";
exit;
}

echo "Selecting database 'foo': ";

if(@mysql_select_db("foo", $dbconnection)){

echo "OK";

}else{

echo "FAILED";
echo mysql_error($dbconnection);
echo "";
exit;

}

//Et cetera...

?>





If you're doing this within an HTML table it could get tricky because you
would need to close the table structure after an error, but otherwise it's
pretty straightforward.  It can be really helpful for debugging and making
sure a script is working correctly!

-Andy


> -Original Message-
> From: Sommai Fongnamthip [mailto:[EMAIL PROTECTED]]
> Subject: display text in screen
>
> Hi,
>   I have easy problem to ask someone.  I wrote PHP to update
> data with many
> step and need to display comment or detail in each step.  But I got all
> comment or detail display after it finished update all step.  How could I
> display each step comment immediately??


-- 
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] Re: Dynamically populating a dropdown box

2001-12-14 Thread Andrew Chase

> I also prefer to use printf(" so it has the value in
> quotes - just a fussy html thing i do though.

If you like your code to be legible in a browser's 'View Source' function
(which can sometimes be helpful for debugging), you can also add a newline
"\n" character to the end of each option line so you get

foo
bar
bat
...

instead of

foobarbat...


-- 
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: WYSIWYG HTML Editor with PHP

2001-12-10 Thread Andrew Chase

It depends on what platform and browser you expect contributors will be
using to add content; ActiveX objects are only good for MSIE/Windows, while
Java has a somewhat broader reach.

WYSIWYG with HTML/DHTML/Javascript is klugey at best, even if it's
PHP-based; PHP is great for making admin screens, handling database stuff
and driving a template engine, but the UI is entirely dependent on the
client's capabilities.

And there are different levels of WYSIWYG; if you're just talking bold,
italic, underline, you could probably get away with a VBulletin-style
(http://www.vbulletin.com/) system where clicking a "B" button next to the
text box drops an empty  tag at the end of the text box contents.  Or
give users a simple tag reference.  If you need a full-blown WYSIWYG HTML
editor like Frontpage or Dreamweaver, you'd probably be better off looking
in the ActiveX/Java direction.

A couple of years ago I remember trying out an ActiveX-based home page
editor called WebWowser that had an MS-Word style toolbar complete with
Bold, Italic, Underline, Insert Image, Insert Table, and numerous other
bells and whistles.  IIRC it hooked into your FTP account on the WebWowser
site and uploaded your desktop images & the pages you made in the editor
seamlessly.  It was pretty slick, but I guess not slick enough to turn a
profit - the WebWowser site seems to have disappeared.

I guess it comes down to who your user base is, how much control they're
allowed to have in formatting their content, and how much handholding
they'll need.

Good luck,

-Andy


> -Original Message-
> From: Ali Nayeri [mailto:[EMAIL PROTECTED]]
> ...we need a very solid
> CMS system
> which has both management capabilities and if possible, has a web-based
> WYSIWYG editor that is idiot-proof.  The problem is, we are not
> sure how to
> start it.  Can it be done using PHP or should be go with the traditional
> Java or ActiveX objects.
> Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com


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




[PHP-DB] RE: postgres optimization

2001-11-26 Thread Andrew Chase

You'll probably want to familiarize yourself with the VACUUM command and
VACUUMDB utility:

http://www.postgresql.org/idocs/index.php?sql-vacuum.html

http://www.postgresql.org/idocs/index.php?app-vacuumdb.html

-Andy

> -Original Message-
> From: Ric Manalac [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, November 25, 2001 10:45 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: postgres optimization

> i'd like to ask anyone who have worked with PostgreSQL
> for any advise on how to optimize its performance.
>


-- 
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] php + MYSQL based banner exchange system

2001-09-19 Thread Andrew Chase

There's also PhpAdsNew, which picks up where PhpAds left off at its last
release in May of 2000:

http://sourceforge.net/projects/phpadsnew/


-Andy


> -Original Message-
> From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 18, 2001 1:42 PM
> To: Andrius Jakutis; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] php + MYSQL based banner exchange system
>
>
> http://www.phpwizard.net/projects/phpAds/
>
> Sincerely
>
>   berber
>
> Visit http://www.weberdev.com Today!!!
> To see where PHP might take you tomorrow.
>
>
> -Original Message-
> From: Andrius Jakutis [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 19, 2001 6:24 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] php + MYSQL based banner exchange system
>
>
> Hello all,
>
> I need your recomendations, where to download from a good (profesional -
> many options) banner exchange system (subj.).
>
> I need it for free (I understand that not everything what is free is
> also
> good :) ).
>
> Any ideas?
>
> Sorry, if my message is offtopic.
>
> Sincerely,
> Andrius
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




[PHP-DB] RE: Could get all data from MYSQL using Mysql_fetch_array!!

2001-08-30 Thread Andrew Chase



> -Original Message-
> From: Andrew Chase [mailto:[EMAIL PROTECTED]]

> Or you could do it longhand -
>
> while ($row= mysql_fetch_array($result,MYSQL_ASSOC))
> {
>   print ("{$row["Reason"]}");
>   print ("{$row["OtherField1]}");
>   print ("{$row["OtherField2]}");
> }
>

Whoa!  Correction there - I forgot the end quotes after "OtherField1 and
"OtherField2

:P

-Andy


-- 
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: Could get all data from MYSQL using Mysql_fetch_array!!

2001-08-29 Thread Andrew Chase

You did fetch all the data by using '*' in your query, but you can't use '*'
as a wildcard when referring to an associative array (which is what $row
is) - you need to step through each key in the array:

while ($row= mysql_fetch_array($result,MYSQL_ASSOC))
{
$fields = array_keys($row);
foreach($fields as $key){
print ("{$".row[$key]."}");
}
}

Or you could do it longhand -

while ($row= mysql_fetch_array($result,MYSQL_ASSOC))
{
print ("{$row["Reason"]}");
print ("{$row["OtherField1]}");
print ("{$row["OtherField2]}");
}

Longhand might even be more useful if you want to format your results
nicely.

HTH,

-Andy


> -Original Message-
> From: Jack [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 29, 2001 8:13 AM
> To: [EMAIL PROTECTED]
> Subject: Could get all data from MYSQL using Mysql_fetch_array!!
>
>
> Dear all
> I was trying to fetch all the data from one of my table
> "leaverequest", but
> i couldn't fetch all the data if i use the * .
> here is my program, this one is only fetch the Reason field, but
> what i want
> is all the data.
>
>  $dblink=mysql_pconnect("microsoft","console","edshk");
> mysql_select_db("nedcorhk",$dblink);
> $query = "select * from leaverequest";
> $result=mysql_query($query,$dblink);
>
> while ($row= mysql_fetch_array($result,MYSQL_ASSOC))
> {
> print ("{$row["Reason"]}");
> }
> ?>
>
> But can i do it like that way to get all the data? (Showing below) :
>
>  $dblink=mysql_pconnect("microsoft","console","edshk");
> mysql_select_db("nedcorhk",$dblink);
> $query = "select * from leaverequest";
> $result=mysql_query($query,$dblink);
>
> while ($row= mysql_fetch_array($result,MYSQL_ASSOC))
> {
> print ("{$row["*"]}");
> }
> ?>
>
>
> Pls help me!!
>
> Thx
> jack
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
>
>


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




[PHP-DB] RE: Probably a stupid home server question ........

2001-07-19 Thread Andrew Chase

Make sure ahead of time whether the cable ISP gives you a static IP address
or a dynamic one... Most of them in the US only give you dynamic IP's.  They
don't change all that often, but it does make it tough to host a domain name
if your IP address is liable to change at any given moment.  Also, read
through the Terms of Service... the ISP may explicitly forbid you from
running *any* kind of a server on their connection.

But otherwise, it's a lot of fun running a server at home... it's a great
use for an old box that would otherwise be gathering dust, and being able to
compile and configure your web server exactly the way you want it is great.
Even if you don't have a static address, you can sign up with a service like
dyndns.org.

And of course, make sure your home server is secure, especially if you use
it as a web gateway as well as an http server :)

-Andy

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]

> Subject: Probably a stupid home server question 
>
 I have Windows 2000 with php, mysql, mssql etc
> . and redhat linux 6.2 with the same - would it be possible
> to set it up from home bearing in mind my website will be the
> only site hosted on it?


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




[PHP-DB] RE: PHP Mysql apache economy hosting

2001-07-13 Thread Andrew Chase

I used Cedant.com to host my own site for a few months, and they were
excellent - no down time that I was aware of, and a handy web-based control
panel (and of course SSH shell access for anything not covered by the
control panel.)  Although they didn't have a large tech support phone bank
(Usually I'd leave a voice mail and get a call or e-mail back within a
couple of hours), their support was intelligent and very responsive.  I
think it was about $12.95/month for the plan I used, which included
PHP/MySQL on RedHat Linux 7.0 and plenty of traffic for my small needs.

-Andy

P.S.  I don't work for Cedant or anything, and the only reason I stopped
using them was that I got my own Linux/PHP/MySQL server going on an old
Pentium 200 at home - no 100% uptime guarantees, but I don't really get any
traffic to speak of so it's not a huge concern. ;-)

> -Original Message-
> From: Ken Sommers [mailto:[EMAIL PROTECTED]]

> Hello,
> can anyone recommend a good
> PHP4/ Mysql/ apache/Unix-Linux economy web hosting co.?


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