If you only have one condition, then get rid of the AND in the where statement;
Select only the fields that you need, instead of *
Like this:
SELECT id FROM $TBL_NEWS WHERE music LIKE '%pop%' ORDER BY name
Peter
At 03:16 PM 11/27/2002 -0500, Benjamin Trépanier wrote:
Hi, I need information
Use this:
function makedate($format, $indate)
{
$temp = explode("-", $indate);
$fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]);
$temp = date($format, $fulldate);
return ($temp);
}
and call it with thi
Your radio buttons look fine. I would ensure to add quotes (single or
double) around the attribute settings, for HTML compliance. If you must go
without quotes, then make sure that you don't put spaces in any of the
attribute values.
As for the form not working... do you have a JavaScript
Anjali,
Use a BUTTON type element, and some javascript:
Peter
At 01:57 PM 9/8/2002 -0700, you wrote:
>hello,
>
>i dont know how to redirect a page... i mean i want to
>have the effect of submit button without clicking on
>the submit button.
>
>thank you
>anjali
>
>___
If you want to put the SELECTED option into your select list while you are
building the page, use an if statement in the ... something
like this:
> Option 1
> Option 2
Peter
At 02:05 PM 9/9/2002 +0300, you wrote:
>Hi,
>
>Can I put the "selected" option of select box later by using php?
Meltem,
You're much better off to use JavaScript to perform the form
validation. This way, when the user clicks on the Submit button,
JavaScript can make sure that values are filled in, or that they are within
range, and can then pop up a message advising them of any errors, and that
they ca
John
Include your template this way:
$file_name="templates/somefile.php"
$New_Content1 = 'This is the new text';
$New_Content2 = 'This is the other text';
include $file_name;
In the template file, have etc wherever the
content should appear.
Then you can put other php code in the template f
Hi guys,
What is the easiest way to get the date of one year from today?
Accommodating for leap years is not essential (but would be a nice bonus).
Thanks,
Peter
- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- -
Reformatting before an inserting/updating is one option, but how would we
change the mySQL database to accept the other format?
Peter
At 04:18 PM 9/12/2002 +0800, Jacob Miller wrote:
>Why can't you just reformat it before inserting it into the db?
>
> $date = "31.12.2002";
>
>
Which is more efficient?
a) a sql loop where everything is displayed/formatted using echo stmts,
like this:
$result = mysql_query("SELECT * FROM news WHERE active=1");
while ($row = mysql_fetch_object($result)) {
echo "$row->title ";
}
mysql_free_result($result);
?>
OR
b) a sql loop
Thanks everyone for the helpful answers.
I agree that manuals are useful, but there are times when an example works
better.
I took all of this information, and some details from earlier posts about
dates, and produced the following function to make it easy to format dates
without have to go
Rick, or anyone,
Based on what you said below, can you describe for me when the
mysql_free_result tag should be used, and when it is not necessary?
I'm fluent in other web languages (iHTML, ASP), but am fairly new to PHP,
so I'm still learning the intricacies of the language, and the best way
Another question about efficiency / using server resources:
In another language I use, I can re-use an ODBC connection to make further
queries/update/etc to the database to save the overhead of closing and
reopening the connection to the db over and over.
It works sometime like this (in the o
A solution that I use is to put important information in an include file,
and store it in a User-Authentication protected folder, ie. /admin/
This adds one extra layer of protection to your files, and keeps the
average joe-surfer from being able to get the files.
Peter
At 08:24 PM 9/19/2002
Tom,
JavaScript is a client side language, while PHP is server side.
This means that the PHP is parsed and evaluated before it ever reaches the
surfers browser. And since the JavaScript variable will not be available
until it is created by the browser, there is no way to interact with it.
Pe
Hi Tom,
Try this:
$years = round($years + ( $themonth / 12 ));
From the manual:
float round ( float val [, int precision])
Returns the rounded value of val to specified precision (number of digits
after the decimal point). precision can also be negative or zero (default).
ceil() and floor()
Patrick
Off the top of my head... Convert both date1 and date2 to unix timestamps,
and subtract one from the other. That will give you the number of seconds
between them. Then, convert to hours, minutes, etc as required.
Peter
At 10:38 PM 9/23/2002 +0200, Patrick wrote:
>i got 2 dates and
Chuck,
Setup your form like this (assuming search.php is the name of your page):
.
Then in your search.php page, use this structure:
# --- set $step to passed value, or else set to default ---
if (isset($_GET["step"])) { $step=$_GET["step"]; }
elseif (isset($_POST["step"])) { $st
Sauron,
Since you're running Win2K, then you can use IIS already installed instead
of Apache. I use Win2K Server, with IIS, PHP 4, and mySQL on my local box,
and it works just fine.
Peter
At 10:55 AM 9/26/2002 -0400, Steve Bradwell wrote:
>Welcome Steve,
>
>You'll need to do two things to g
Hi everyone,
I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even
slower when accessing a mySQL database. It's a PIII-800 with 256MB
RAM. It is otherwise a great machine, and fast.
Any suggestions?
Peter
- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[
systems my clients use.
So, I just need to know if there are some tweaks I should be considering to
speed up PHP?
Peter
At 12:31 AM 10/8/2002 +0900, @ Edwin wrote:
>Hello,
>
>On Tuesday, October 8, 2002 12:19 AM
>Support @ Fourthrealm.com wrote:
> > Hi everyone,
> > I
Hey everyone... do you know where I can find a list of the common returns
of the $_SERVER["HTTP_USER_AGENT"] variable?
For example:
I.E. 5.0 = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; .NET CLR
1.0.3705)
Netscape 4.08 = Mozilla/4.08 [en] (WinNT; U ;Nav)
Thanks,
Peter
- - - - - - -
More details on this...
As I pay more attention to when it is sluggish or not, I notice that it
seems to run fine on a typical page, with or without mySQL connections.
But... the slowdown comes whenever I'm into my frame-based Admin, where 2-3
frames are typically loading at the same time. The
Hey everyone,
For years I have used a fantastic merchant ( http://www.ihtmlmerchant.com
), which is feature packed and easy to setup and use. It's written in a
competing language called iHTML ( http://www.ihtml.com ).
As I am getting considerably proficient at coding PHP, I find that I
require
Hey everyone,
For years I have used a fantastic merchant ( http://www.ihtmlmerchant.com
), which is feature packed and easy to setup and use. It's written in a
competing language called iHTML ( http://www.ihtml.com ).
As I am getting considerably proficient at coding PHP, I find that I
require
Eddie,
This is a function that I wrote to handle this same situation:
# --- Function to format date output ---
function makedate($format, $indate)
{
$temp = explode("-", $indate);
$fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]);
Bob,
Instead of dividing, use modulus to get the exact number of remaining
seconds, and then determine the minutes from that.
Here is some code that I've quickly adapted from another language I use, to
take the total minutes, and convert it to "hours:minutes" display.
$totalmins = 193;
$showmin
Eddie,
I use the attached on a site of mine... works with JavaScript and tags.
There are 2 parts to the file - the javascript, and then the HTML code to
make it happen. Tweak according to your needs.
Peter
At 11:00 AM 11/20/2002 -0500, you wrote:
I have a large amount of data to present to t
he iframes limited?
Thanks,
Eddie
-Original Message-----
From: Support @ Fourthrealm.com [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 11:23 AM
To: Edward Peloke; [EMAIL PROTECTED]
Subject: Re: [PHP] scrolling data from db
Eddie,
I use the attached on a site of mine...
Justin,
Creative thinking to a smart solution. I will keep that in mind for future
sites.
Peter
At 10:35 AM 11/21/2002 +1100, Justin French wrote:
> If you know that your client base will ever only use IE, then go for
> it. Otherwise, you'll have to avoid the iframe.
That sounds a little hars
30 matches
Mail list logo