On 04/05/2010 09:03 PM, Karl DeSaulniers wrote:
Hello List,
I am hoping this will be a quick and easy for someone to help me with.
I am trying to create an upload form that lets a user upload a product
photo to the server.
In the process of this upload, I want to take the file they are
This is well-documented in the String part of the Data Types section:
http://www.php.net/manual/en/language.types.string.php
-Rasmus
Mark Casson wrote:
Hi Guys,
Thanks to you both - you are spot on!
Shame this is not better documented somewhere.
Mark
Mark Casson
There are many ways to do it. I prefer one of these two:
?php
echo EOB
table align=center width=$width
EOB;
?
or.
table align=center width=?php echo $width?
-Rasmus
Micah Stevens wrote:
I apologize, I was being rude.
More specifically, I don't see why you say all html tags should be
Micah Stevens wrote:
Rasmus, there's a shortcut for this:
?php echo $width?
?=$width?
Saves me a lot of time, although it can be confusing for those unfamiliar
with
it.
Yes, I am quite familiar with it ;)
But I don't like it. It's an ugly ASP'ism.
-Rasmus
--
PHP Database
mario wrote:
hi,
silly question: what is EOB?
google returns:
Your search - EOB site:www.php.net - did not match any documents.
I see your (short) side note on EOB on
http://www.oracle.com/technology/pub/articles/php_experts/rasmus_php.html
EOB is not an entry in your 'programming
Chris wrote:
You could create a string, loop through it's length, then access the $i
character in the string.
$sAlpha = 'ABCDEF...XYZ';
for($i=0;$i26;++$i)
{
$sLetter = $sAlpha{$i};
// code
}
range() is a powerful function for creating such strings. You don't
need to loop.
Absolutely nothing wrong with that solution. But here is an alternative
just for fun:
for($letters = range('A','Z'), $i=0; isset($letters{$i}); $i++)
echo $letters{$i}. ;
-Rasmus
Miguel Guirao wrote:
Thanks!!
I think the ord() function should receive an integer as a parameter and it
The actual code for the first MySQL extension was just a search and
replace of msql-mysql in the original msql extension I wrote before
that. I found 1995'ish documentation for that the other day:
http://lerdorf.com/php/msql.html
And that extension was based on the original msql support in
Chris Payne wrote:
Hi everyone,
Im trying to split a string by comma, but its not working, can you see
any reason that the below doesnt work?
$keywords = preg_split(',','$Agent_Rep');
Not sure why you sent this to php-db, but have another look at the
preg_split documentation. You need
delete from table_name
On Wed, 26 Nov 2003, Chris Payne wrote:
Hi there everyone,
Just a quick question which I can't for the life of me find the answer for on
MySQL's website (Probably as i'm looking for the wrong term?) I want to know how to
empty a table, is there an empty command or
Your question makes very little sense to me. PHP is not a database
obviously. Also, MySQL has foreign keys and triggers and it can do
cascading actions. So I don't understand what you are talking about.
-Rasmus
On Tue, 28 Oct 2003, Morten Gulbrandsen wrote:
MySQL as database for PHP,
On Tue, 1 Jul 2003, Nabil wrote:
You need to purchase commercial non-GPL MySQL licenses:
a.. If you distribute MySQL Software with your non open source software,
b.. If you want warranty from MySQL AB for the MySQL software,
c.. If you want to support MySQL development.
So Why it is
On Tue, 1 Jul 2003 [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Rasmus Lerdorf) wrote in
news:[EMAIL PROTECTED]:
On Tue, 1 Jul 2003, Nabil wrote:
You need to purchase commercial non-GPL MySQL licenses:
a.. If you distribute MySQL Software with your non open source
software, b
On Sun, 29 Jun 2003, Ben Lake wrote:
Anyone have an input on the recent announcement that about MySQL
libraries not being present in PHP 5. What other means might be
available to connect to MySQL?
This only affects the bundled library. It doesn't mean the MySQL
extension is going away. Just
On Sun, 29 Jun 2003, Marco Tabini wrote:
The MySQL extension has been debundled because MySQL has changed its
licensing policy and, effective 4.0, the library is now distributed
either under the GPL (which is incompatible with the PHP license) or by
purchasing a commercial license.
Please
You have to load the extension in your php.ini file. eg.
extension=mysql.so
-Rasmus
On Tue, 10 Jun 2003, Sparky Kopetzky wrote:
Good afternoon!
I have Apache w/php installed on one server. I have mysql installed on a windows
machine. I keep getting this error
'Call to undefined
A single img src=script.php can only show a single image. If your
script.php generates two complete images, then I would think the browsers
would choke, but perhaps they fail gracefully and only show you the first
one. If you want two images, you need 2 img src... tags and thus two
calls to your
Wrong mailing list.
--with-gd
On Mon, 3 Mar 2003, nate hurto wrote:
According to the GD web site http://www.boutell.com/gd/, there is native GD
support in v4.3.0. Anyone know how to enable this support?
Thanks.
Nate.
--
PHP Database Mailing List (http://www.php.net/)
To
Their comments do make sense, and without seeing your code it is
impossible to say whether they are correct or not. They are basically
saying that you have written some very inefficient code. 700 requests an
hour should never come anywhere close to bogging anything down unless you
have
Which DB? MySQL supports encrypted connections.
On Mon, 25 Nov 2002, Lisi wrote:
I am writing a content management section for a site that will use as part
of the front page three small sub-sections from another site's home page
(with their permission, of course).
They are worried about
need to look at?
Thanks,
-Lisi
At 12:09 AM 11/25/02 -0800, Rasmus Lerdorf wrote:
Which DB? MySQL supports encrypted connections.
On Mon, 25 Nov 2002, Lisi wrote:
I am writing a content management section for a site that will use as part
of the front page three small sub-sections from
Is there any secure way to connect using these versions? I am on a virtual
host so there's not much I can do about upgrading. Also, does it matter
which versions the server I am connecting to are running?
-Lisi
At 12:22 AM 11/25/02 -0800, Rasmus Lerdorf wrote:
See php.net/mysql_connect
We do mention it at http://www.php.net/mailing-lists.php
I'll post the mailing list guidelines here as well, as it is good to
remind people every now and then:
* Use a valid email adress. Every new poster's email address is
checked for validity through confirmation.
* Send plain
addslashes()
On Sun, 17 Nov 2002, Peter Beckman wrote:
Having a little trouble doing some inserts into a db.
The problem is escaping the right characters. Data integrity is important.
Right now, I have taken an email and split it into $body and $header
(containing the respective parts of
CREATE TABLE `SessionsTable` (
`SID` varchar(32) NOT NULL default '',
This doesn't need to be a varchar. The sid will always be 32 chars, so
make it a char(32)
`expiration` int(11) NOT NULL default '0',
I would suggest using a timestamp type here so MySQL will handle
updating it for you
You sure you want [$i] on that? Is it a 2-dimensional array?
On Wed, 6 Nov 2002, Aaron Wolski wrote:
Hey all,
Can't seem to figure out why this won't work:
$test = implode(,, $order_index[$i]);
When I print_r() the variable I have values so I know that works.
Any thoughts on this?
Sounds interesting. Perhaps toss it into PEAR/PECL and see if anybody is
interested in pitching in with maintenance. You never know, someone might
pop up and add a bunch of improvements that will benefit you directly.
-Rasmus
On Sat, 2 Nov 2002, Robert Twitty wrote:
Hello
I have been using
PHP 4.3 handles this correctly. Give a snapshot from snaps.php.net a try.
-Rasmus
On Fri, 18 Oct 2002, Benjamin Schleinzer wrote:
Hi
I Am using the latest PHP version 4.2.3 with MySQL 3.23.51-max. I use
InnoDB tables for transactions and everything works fine with Rollback and
Commit. But
So loop through and check the last char. Am I missing something that
makes this harder than the obvious:
foreach($arr as $key=$val) {
$end = $val[strlen($val)-1];
switch($end) {
case '1': $arr[$key] = substr($val,0,-1); break;
case '2':
case '3': $arr[$key] =
echo $Name;
Or if register_globals is off in your php.ini, use:
echo $_POST['Name'];
-Rasmus
On Fri, 4 Oct 2002, Shoulder to Shoulder Farm wrote:
Hi all,
Sorry, but I REALLY don't want to subscribe to the PHP general list,
it's so high volume, so here goes. --T
How can I get values that
Whoever told you that was wrong. It will not be deprecated, the default
php.ini setting was merely changed. If you have a php.ini file and you
upgrade you won't notice any change whatsoever.
-Rasmus
On Mon, 30 Sep 2002, Ryan Jameson (USA) wrote:
I was recently told this:
register_globals
$REMOTE_USER
On Thu, 5 Sep 2002, Keith Spiller wrote:
Hello,
If I were to use a plain old htaccess file with a htpasswd file for user
authentication, rather than php files, could PHP somehow later retrieve the username
used through some system or browser variables?
I would assume that
Most of this stuff is actually just SQL and has little to do with PHP. So
look for an SQL tutorial. From the PHP side all you need to know is
mysql_connect(), mysql_select_db(), mysql_query() and mysql_fetch_row().''
All queries are sent to the database via mysql_query(). It doesn't matter
to
Chances are the files-based one is probably a bit quicker. Especially on
systems where /tmp is optimized or perhaps even set up as a ramdisk.
-Rasmus
On Wed, 21 Aug 2002, Jonathan Thomas wrote:
Good afternoon!
Quick performance question - I'm currently preparing the release of a new
It is obviously missing libpq
You need to installed the postgresql libraries. If you are installing
from packages, install the postgresql-devel package.
-Rasmus
On Thu, 1 Aug 2002, Jan Feller wrote:
Hello!
IĀ“have a problem compiling PHP 4.1.2 with PostgreSQL.
Running the Makefile returns
I would suggest looking into MySQL's replication support. Split reads and
writes so they go to separate servers. That is, create a master server
where you send all database writes. And do all reads on the replicated
slave servers.
Have a look at this presentation I gave last week on this
What do you mean it uses 2? It does not.
On Tue, 30 Jul 2002, Andrey Hristov wrote:
Maybe it will help you but I've read that when using persistent connections
PHP uses 2 on every request.
So if in one moment you have 10 scripts,that use persistent connections,
running you will have 20
have been to increase the MySQL max_connections parameter from the
default of 100.
[/snip]
Andrey
- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Cc: Paul Worthington [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 7
There is no imagejpeg() call in the code snippet you provided. And you
don't say how it is failing. You haven't provided us with enough data to
answer this question.
-Rasmus
On Sat, 29 Jun 2002, andy wrote:
Hi there,
I would like to save a jpg into a blob field of mysql. The function
Well, where is your ';'? At the end of the statement? You don't
terminate queries with semi colons when talking directly to the database.
Just remove it.
-Rasmus
On Sun, 26 May 2002, Dave Carrera wrote:
Hi All
I have found the problem from my last post and need to know how to solve it.
Ah, there is the issue. You cannot issue 2 SQL queries in a single
mysql_query() call. You have to do them one at a time without the ;
-Rasmus
On Sun, 26 May 2002, Janet Valade wrote:
Can't you do what you want to do without using two SQL statements?
CREATE TABLE IF NOT EXISTS.
Janet
I think it an issue with including multiple sql commands in one var...
Yup, you can't do that. Simply separate them and do them one at a time.
-Rasmus
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
MySQL has plenty of functions to return dates to you in any format you
specify. Please read
http://mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_functions
and pay special attention to the DATE_FORMAT() function.
-Rasmus
On Sun, 13 Jan 2002, Sander Peters wrote:
(and possibly in some situations, vice-versa)?
Regards,
=dn
- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Sander Peters [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 13 January 2002 19:52
Subject: [PHP-DB] Re: [PHP] convert /mm/dd to mm/dd/
No, you need to disable short_tags and use ?php ... ? for all your PHP
tags if you are going to mix PHP and XML tags in the same file.
-Rasmus
On Fri, 7 Dec 2001, Steve Haemelinck wrote:
Hi Guys
I am developing with PHP and XML. Now I experience some problem with the
processing
the variable MYSQL_SOCKET is set to /tmp/mysql.sock and i need it to
be /var/lib/mysql/mysql.sock is there anyway i can set this variable
in php?
From http://php.net/mysql_connect :
resource mysql_connect ([string hostname[:port][:/path/to/socket] [, string username
[, string password]]])
?
thanks,
jay
- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Jay Paulson [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; php [EMAIL PROTECTED]
Sent: Thursday, August 16, 2001 2:45 AM
Subject: Re: [PHP] MYSQL_SOCKET
the variable MYSQL_SOCKET is set to /tmp/mysql.sock and i
When a user fills out a form field that includes an apostrophe ex. Jen's ,
the verify screen shows it as Jen\'s and it
That's because magic_quotes_gpc is enabled in your php.ini file. You can
turn this off if you wish, or simply do a stripslashes() on the string
you are displaying.
is then
nl2br()
On Sun, 22 Apr 2001, Jennifer Arcino Demeterio wrote:
It works! Thanks for the help!
Anyway, I hope you won't mind if I'll ask you another question, when the
text type is pulled out from the MySQL
database into my display script it can't recognize the new line. It diplays
the text
Uncomment this line in your php.ini file:
extension=php_pgsql.dll
-Rasmus
On Thu, 19 Apr 2001, Jerome O Macaranas wrote:
using PHP 4.0 under Win2K IIS 5.0
got this error
- Fatal error: Call to undefined function: pg_connect() in
C:\Inetpub\PHPwwwroot\index.php on line 17
is there
That said, (Now on to actual PHP) I've noticed (in my own scripting) and a
few other problems posted here quite a bit of confusion with PHP's single '
and double " quotes. Reading the material I was led to believe that
' ' outputs exactly what is in the quotes and
" " outputs variables
No
On Sat, 7 Apr 2001, Jeff Oien wrote:
Are encode and decode secure enough for storing credit
card numbers on a Web server?
Jeff Oien
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To
Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: 20 March 2001 16:09
To: Steve Brett
Subject: RE: [PHP-DB] problems configuring php and postgres - "call to
und efined function"
Well, you just didn't point PHP at the right place then.
On Tue, 20 Mar 2001, S
What kind of binary install did you do? An rpm? If so, simply also
install the rpm-devel package and it will compile nicely.
-Rasmus
On Tue, 20 Mar 2001, Gary Huntress wrote:
I am trying to get postgresql (pg) support for php working on my RH7 box. I
had a working binary installation of
54 matches
Mail list logo