Try something along these lines:
...
Date:
Time:
Cost:
Colour:
...
...
mysql_query("SELECT " . implode(',', $_REQUEST['columns']) . " FROM
tablename");
...
?>
This should product a query like
SELECT date,time,colour FROM tablename;
And it's a lot neater than writing a huge chunk of code to g
From the manual:
In PHP 4, only constant initializers for var variables are allowed. To
initialize variables with non-constant values, you need an
initialization function which is called automatically when an object
is being constructed from the class. Such a function is called a
constructor (s
Sam
Your problem probably does stem from the extension not being installed.
You say you're using (IIRC) mySQL 4.1
This requires you to use the mysqli extension, not the mysql extension
As you're on windows, it's probably just a case of uncommenting the
extension=php_mysqli.dll
line in your php.ini,
Try this:
http://uk.php.net/output_add_rewrite_var
Dennis Gearon wrote:
You make a good point, Marek. They CAN open a new window with
different results. Maybe it's up to each page to keep track of where
it is at, via form elements alone, instead of through session values.
Hadn't thought of that,
You can try this:
http://open.thumbshots.org/image.pxf?url=http://www.php.net
But I'm not sure how useful it will be to you - it's a database of
thumbnails, not a tool to dynamically generate them.
[EMAIL PROTECTED] wrote:
Has anyone run across a tool available to PHP that can render an image of
Or alternatively
$result = mysql_query("SELECT * FROM tablename");
if (mysql_num_rows($result))
{
while ($row = mysql_fetch_row($result))
{
// display results
}
}
else echo "No results";
Hope this helps
Cheers
Chris
John Nichel wrote:
Dustin Krysak wrote:
Hi there... I have a simple search pa
Zoran
Sounds like your problem is with line endings - your unix (i presume)
box ends its lines with a newline (\n)
Windows ends lines with a carraige return followed by a newline (\r\n or
CRLF)
Notepad doesn't recognise a newline on its own as either a valid
character or a valid line ending, s
Perhaps it's something Freudian to do with your chequered past
Just a thought :)
John Holmes wrote:
Subject: Re: [PHP] something like an SID
Anyone else read that as "something like an STD" ?? and thought we were
getting more spam to the list!?!? ;)
---John Holmes...
--
PHP General Mailing List
Irrelevant, Warren
Mag,
the point is that you're trying to use a function (filesize) that uses
the stat() system call. This function is not supported using the http
wrapper to fopen (because HTTP doesn't support it at all)
So regardless of whether you should be using the file name or the handle
Chances are your 1KB file contains an error message - try changing the
Content-Type to text/plain or text/html to see what PHP is throwing at you
Cheers
Chris
Marek Kilimajer wrote:
PHP Junkie wrote:
Ave,
I've been having a very nagging and frustrating problem for a while
and I
hope someone can
All this is irrelevant; while you're still trying to use MySQL 5 with
mysql_connect() instead of mysqli_connect(), it WILL NEVER WORK
Sort that out first before you start worrying about firewalls - you
can't test the firewall if you can't ever have a successful test case.
Cheers
Chris
Markus Ma
Not really a MySQL question - the answer happens to be MySQL, but the
question asks how to do it in PHP
This might still be necessary if the OP is using something like
DB_DataObject, as you can't really use NOW() in that situation
Try strftime [ http://uk.php.net/strftime - RTFM :) ] - a good f
Are you by any chance doing something like this?
while (1)
{
$dbh = mysql_connect(x, x, x);
mysql_query(...);
sleep(10);
}
If so, you could run into that maxclients problem very quickly because
you're not closing those mysql connections (they'll time out eventually,
and there are persistent co
And after that - go and try to find out a little on your own - contrary
to a common misconception, it's not the sole purpose of members of this
list to write all your code for you.
The old favourites RTFM and STFW would serve you well here - there are
thousands of PHP tutorials that will tell y
Just to clear up, there is no isempty() function - the correct function
is empty() and its details can be found here: http://uk.php.net/empty
Cheers
Chris
-{ Rene Brehmer }- wrote:
At 01:54 20-09-2004, Chris Mach wrote:
What is the best way to determine if a variable is empty?
I have a feeling th
If course, if you don't have shell access, phpMyAdmin is all you'll ever
need
http://www.phpmyadmin.net
Cheers
Chris
Brian V Bonini wrote:
On Mon, 2004-09-20 at 19:37, Stut wrote:
On Mon, 20 Sep 2004 16:20:21 -0700, AMC <[EMAIL PROTECTED]> wrote:
Is there a tool that will generate a scrip
Sam,
You're correct - the manual does leave a little bit of a grey area about
which extension you should use for 4.1.0 < MySQL version < 4.1.3
However, as you're using 5.0.1 this really shouldn't confuse you to
quite the extent which it has.
Sam Hobbs wrote:
"Curt Zirzow" <[EMAIL PROTECTED]> wr
[snippy]
Sam Hobbs wrote:
Um.. you do realize you have more problems than php not being able
to connect to the database.
This is the type of unproductive comment that causes problems. The only
reason you are saying this is because you are desperate to make me wrong.
You have exhausted reason
Yeah
I've rebuilt a huge CoOperative Marketing Fund Administration tool using
version 1.3 or 1.4 (I can't be arsed to look right now).
It's good for what it does - the only problem I have lies in the fact
that the classes you generate for actions and views are generally quite
large, and if the
That's not 100% correct
If you have more than one TIMESTAMP field only the first (IIRC) will be
filled with the current time - other TIMESTAMP fields will only be filed
if you set them = NULL.
This is true of MySQL < 4.1.2 - there is more fine-grained control over
the behaviour from 4.1.2 onwar
I think you really need to contact your hosting company and berate them
for lying to you.
Like Jason says, the definitive list is from *your* php_info(), not the
hosting companies - you might like to send them copies of both and ask
them to explain the differences.
Cheers
Chris
missshus wrote:
Guys
Without hacking the pear library, does anyone know of any way (using the
API) to change the background color of an image created with Image_Text
from black?
The bg is black because the image resource is created using
imagecreatetruecolor() which returns a black image - this is on some of
Just FYI
I figured it out - there is an $options['canvas'] option which accepts,
amongst other things, a handle to an image resource. Trivial then to use
imagecreate() and imagecolorallocate() to create a white-background
starting point.
Sorry for wasting everyone's time
Che
it seems that php first ends output buffering and then calls then
destructs the objects. so the output buffering is still ended when the
destructor is calles. one has to unset the object to reverse that
order manually.
aRZed
If I remember correctly, there were a number of posts about this subj
http://uk.php.net/imagecolorallocatealpha
Todd Cary wrote:
I would like to place text on a graphic but vary the transparency of
the text. Can this be done with the gd library?
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
You can get around this problem more easily by putting your variables
inside curly brackets when they appear inside strings.
See here:
http://uk.php.net/manual/en/language.types.string.php#language.types.string.parsing.complex
Or as an example:
$Query01 = "SELECT * FROM Users
WHERE UserID = '{
Guys
According to the docs, you need to use either php://stdin or php://input
to read from files uploaded via PUT, however I'm unable to get even
that far.
My HTML form is as shown:
However both firefox & IE use GET instead of PUT. Has anyone used PUT
for anything, and if so, how did you g
Header("Content-type: application/ms-excel");
or whatever the content type should be (on IE you can probably get away
with application/octet-stream as it bases its decisions of file
extensions for a lot of things).
HTH
Chris
Philip Thompson wrote:
How exactly would I change the mime headers?
~Ph
rver. I am hoping that the
gateways will respect this fact (although I'm not holding my breath).
If anyone has any alternate suggestions (other than "Stop using MS
gateway servers", which is unfortunately impossible given our clients),
I'd be happy to hear them.
Cheers
Chris
John Ni
sorry
[skulks off into dark corner to cry]
Philip Thompson wrote:
Chris, as you may have (or may have not) noticed, I did that. Look at my
original email. I wasn't sure if there was more to it than that.
~Philip
On Oct 13, 2004, at 8:34 AM, Chris Dowell wrote:
Header("Content-type: a
In an attempt to make amends, have you tried PEAR's
Spreadsheet_Excel_Writer?
http://pear.php.net/package/Spreadsheet_Excel_Writer
It certainly works, we used it last week (although I have no *personal*
experience of it)
Cheers
Chris
Chris Dowell wrote:
sorry
[skulks off into dark corn
No
I think it's more likely that one of his tentacles slipped
Chris Shiflett wrote:
--- John Holmes <[EMAIL PROTECTED]> wrote:
header('Location: http://www.example.org/script2.php?".SID);
He is human after all. :-)
Chris
=
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly HTTP
try $Arr[] = array('name' => 'arnold', 'address' => 'street');
Arnold wrote:
Hi,
How can i add new items to an array without using an index.
Normally (single dimension) you can do: Arr[]="x" and this item is
added to the array, but what if i have subitems like:
Arr[]['name']="arnold"; Arr[]['a
Try is_int($_POST['mobile_number']) or ctype_digit($_POST['mobile_number'])
HTH
Cheers
Chris
Robert Cummings wrote:
On Fri, 2004-10-15 at 07:45, Gareth Williams wrote:
Do you even need a regex?
What about
if (strlen($_POST['mobile_number']) != 11 &&
substr($_POST['mobile_number'],0,3) != 447)
{
$
Problem 1)
$h_1 = 600;
$w_1 = 800;
$h_2 = 120;
$w_2 = $w_1 * ($h_2 / $h_1);
Problem 2 a)
Assuming you're wanting the central portion of the original image (which
I think you are from what you've written)
$h_1 = 600;
$w_1 = 800;
$h_2 = 120;
$w_2 = 90;
$x = ($h_1 - $h_2) / 2;
$y = ($w_1 - $w_2) / 2
I think you've a couple of problems with your second problem (problem
problem problem).
First of all, you're setting $dst_h to 0, which gives you a height of 0
- IIRC that's not what you wanted :)
You should be setting that $dst_h = 120 as you always want it to be 120px
I reckon that your code
There's also a pear package that might help you:
http://pear.php.net/package/Text_Highlighter
Cheers
Chris
Jason Wong wrote:
> On Tuesday 28 September 2004 12:40, [EMAIL PROTECTED] wrote:
>
>
>>How can I make a code into html format like this
>
>
> You can have a look at the highlight_file(
In PHP4
$array = explode(';', chunk_split("A12B05C45D34", 3, ';'));
In PHP4
$array = str_split("A12B05C45D34", 3);
RTFM
Cheers
Chris
blackwater dev wrote:
How can I take a string and create an array?
Example,
A12B05C45D34
I need to split this into chunks of three A12,B05,C45..etc?
Thanks!
--
PHP Ge
Nice idea, but you want to be "future-proof", don't you?
Once alt.binaries.vr.animals.lobster starts filling up with 5 hour
Virtual Reality ROMs you're looking at needing a lot more than that. I'd
go with about 6 YB if I were you, and that's only because there aren't
any SI prefixes higher than
Matthew Sims wrote:
Nice idea, but you want to be "future-proof", don't you?
Once alt.binaries.vr.animals.lobster starts filling up with 5 hour
Virtual Reality ROMs you're looking at needing a lot more than that. I'd
go with about 6 YB if I were you, and that's only because there aren't
any SI pref
As Marek has stated a number of times, the session options in php.ini
are meant to be set to reasonable values for the usage pattern for your
server, in order that you can achieve a balance between a /tmp or
/var/tmp of several zillion kilobytes, and a constant 100% cpu usage as
the gc routine runs
Of course, you're running unserialize() twice.
What about
if (empty($_COOKIE['bookmarks']) || !($bookmarks =
unserialize($_COOKIE['bookmarks'])))
{
$bookmarks = array();
}
Does the same with only one call to a potentially weighty function.
Cheers
Chris
John Nichel wrote:
Brian Dunning wrote:
I
From the manual:
http://uk.php.net/manual/en/language.pseudo-types.php#language.types.callback
If you want to change things in the callback, the function (or method)
should accept its parameters by reference.
e.g.
class A
{
function name(&$a, $b, $c)
{
$a = $b . $c;
return;
}
function p
Of course, you're running unserialize() twice.
What about
if (empty($_COOKIE['bookmarks']) || !($bookmarks =
unserialize($_COOKIE['bookmarks'])))
{
$bookmarks = array();
}
Does the same with only one call to a potentially weighty function.
Cheers
Chris
John Nichel wrote:
Brian Dunning wrote:
I
Stuart,
Having read what you've written so far, you may want to try something
like this.
In your HTML (I've left the selects empty, but you can see what I mean):
...
Then in PHP
foreach ($_POST['skills'] as $skill)
{
$skillname = $skill['name'];
$yearsused = $skill['years'];
$lastus
Francisco
You really need to post this to [EMAIL PROTECTED] - this list is
for us lowly users of PHP, the developers and maintainers of the
language have their own list.
Cheers
Chris
Francisco M. Marzoa Alonso wrote:
Can someone tell me if I should fill a bug report about this or is it my
fault
You could also try a combination of html_entity_decode to change all
entities back, then truncate it, then use html_entities to get back to
the encoded string.
Hope this helps
Cherrs
Chris
Robert Cummings wrote:
On Mon, 2004-10-18 at 14:35, Murray @ PlanetThoughtful wrote:
Hi All,
I'm working on
Deleo
We had an interesting conversation on this last just last week regarding
the length of sessions.
The title of the thread is "[PHP]Sessions not destroyed". Try searching
the archives with that text.
I believe Marek's and my own messages may have the information you're
looking for - basica
Aidal
Could you post the relevant parts of your code so we have a little
context to work in?
You say you're copying a file from one location to another on the same
server. If this is the case you are very unlikely to be in need of the
ftp family of functions, which are only valid for use over a
Shaun
The problem is that you've assigned $test_array[] = array();
This means that the first element ($test_array[0]) is an array.
You're then trying to add $i to it, as in $test_array[$i] =
$test_array[$i] + 1;
in terms of types what you're doing is array = array + integer
Which doesn't make any
That is, expected results, *apart* from the infinite loop you'll have
due to not incrementing $i
Cheers
Chris
Chris Dowell wrote:
Shaun
The problem is that you've assigned $test_array[] = array();
This means that the first element ($test_array[0]) is an array.
You're then trying
Murray
I'm guessing that IE sends $recid = '' whereas firefox doesn't send it
at all because it's an empty form field.
Try checking for empty($recid) instead - that way you can check that it
not only exists (as in isset) but also that it has a value (i.e. not '',
NULL, 0 or FALSE)
Hope this he
52 matches
Mail list logo