Robin Kopetzky wrote:
Good afternoon.
I found this code in a program I'm renovating and think this is very
redundant. Also, it does slow queries down while doing all of the
conversions.
prod_id in the mysql database is declared an integer.
where prod_id = '" . (int)$prod_id . "' and
Qu
If you are trying to replace the carriage return it needs to be \r
instead of \ n in your query. Also it may not work because in my
experience the replace function under mysql does not replace them in the
db but in the query results. If you are looking to replace them
permanently you will need a sc
ct("$ftp_server");
$upload = ftp_put($conn_id, "$destination_file", "$source_file",
FTP_BINARY);
ftp_quit($conn_id);
how depends on the application ?
- Original Message -
From: "David Smith" <[EMAIL PROTECTED]>
To: "open-mind" <[EMAIL PRO
> which is the "best" upload file method ?
> file uploads or FTP commands from PHP
Now that's the most open ended question I've read all day. Here, flip a
coin. If it falls heads, FTP. If it falls tails, the other one. Even
still, I'm not sure I understand the question: File uploads or FTP command
One comand and you are done:
apt-get install mysql-server httpd php php-mysql
Don't have apt for RedHat? Download this:
http://ftp.freshrpms.net/pub/freshrpms/redhat/8.0/apt/apt-0.5.5cnc6-fr0.rh80.1.i386.rpm
and run 'rpm -i' on it. There's no better way to install software than
apt. Pre
David Smith wrote:
insert into database1.tablename select * from database2.tablename;
database1 and database2 are the names of the two databases. tablename
is the name of the table you want to copy from database1 to database2.
Correction: from database2 to database1, not vice versa
Have you tried something like this:
insert into database1.tablename select * from database2.tablename;
database1 and database2 are the names of the two databases. tablename is
the name of the table you want to copy from database1 to database2. In
your case I guess this would be:
insert i
>> >I've tried to use $USERNAME variable but it isnt what i want because it
>> >recognize login name on server not remote user
>>
>> If you are referring to the Windows login name, this is not possible
>> with PHP via the web browser.
>
> Sure it is. It's usually in $_SERVER['LOGON_USER'] or somet
Lars Jedinski wrote:
I have to copy files created with php on www.aaa.com
to another domain, e.g. www.bbb.com
Is and if how is this possible with PHP?
If you have an FTP server running on www.bbb.com, then it is possible.
Here are the relevant functions:
http://php.net/ftp
And here's some re
SpychaĆa Wojciech wrote:
I have to do user recognizing in m php project. Simplest method i know is to
recognize for example login name (when user is logging into his local PC)
I've tried to use $USERNAME variable but it isnt what i want because it
recognize login name on server not remote user
If
Gnanavel wrote:
I have problem in executing linux command
$output=exec("ls -a");
echo "$output";
the above coding works, but
$output=exec("cp file1 file2");
echo "$output";
does not works. can any one help me out of this problem
When I was executing the "cp" command it doesn't return anything.
Just do a mysqldump on the command line. It will dump a whole bunch of
SQL code that can be used to recreate the database in the event of
disaster. You could even pipe the output to gzip to compress it.
mysqldump --all-databases -u root | gzip -c > mysql_backup.gz
That works fine for me. The
> I would like to compare 2 tables in a database to determine which records
> are different!!! Any clues out there. Thanks in advance!
You didn't say which DBMS you are using. If you're using a DBMS which
supports INTERSECT (not MySQL), and assuming the two tables have the same
column names and
This doesn't have much to do with PHP and databases, but here's a thought:
You can leave them all .htm and have apache treat .htm files as .php
files. Just check out httpd.conf for configuration. If your box is
sufficiently zippy, you will see now slow down by running pure html
files through PH
Try this (taken from http://us2.php.net/manual/en/ref.datetime.php):
*menaurus at gmx dot de*
16-Jul-2003 02:37
|The argument has to be in the standard mysql format (y-m-d)...
function age($date) {
if (!$date) return false;
$year=0+substr($date,0,4);
$month=0+substr($date,5,2);
$day=0+subs
Suman Aluru wrote:
hi ,
is there any way to write a PHP program for SSH.
I want to establish a SSH connection and work some commands in the remote
system and close the connection.
Yes, just do this (uses an SSH key file):
";
echo `ssh -i /path/to/key/file [EMAIL PROTECTED] ls /tmp`;
echo
Thanks. That works perfectly.
David Smith
-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 3:36 PM
To: David Smith; php-db
Subject: Re: [PHP-DB] Formatting numbers
> I am a little new to PHP, but I am trying to pull numbers fro
if so how
do I make it change from a comma and every three spaces to fit the formats
above? I know that this is probably pretty simple, but I can't seem to find
the answer anywhere (possibly right under my freakin' nose :D).
Thanks.
David Smith
does make
it a little simpler so that you can plan for 14 weeks of whatever you're
doing.
David Smith
On Wed, 2003-07-23 at 01:32, Stephen March wrote:
> Have you considered using the console-tool, "mysqldump " ?
> You could write a quick script ... say
>
> mysqldump
want, and tell your boss it's
as easy for you to add fields to the database as it is for him to add
them to excel :D.
These of course are just my opinions so you can always take it or leave
it as if I said nothing at all.
David Smith
On Tue, 2003-07-22 at 22:35, Ow Mun Heng wrote:
> Hi
You are referencing variables that you have not created (or perhaps
array indexes that don't exist). To suppress these messages, fix your
code to not do such things, or just put this at the top of your scripts:
error_reporting( E_ALL ^ E_NOTICE );
Or edit php.ini to make it happen globally:
Boa Constructor wrote:
The first line below works but the second one doesn't. If $quantity were to
equal 0 then I want both of these to do exactly the same thing.
echo "";
echo "Remove Item";
Are you using POST or GET on the receiving end of the script? Also, try
urlencoding the href like th
Tony S. Wu wrote:
I have an auto-update script to gather some information from other web
pages to update information in my database.
And i use fopen() to open the URL.
as far as i know, the return result contains image, which i don't need.
If you call fopen()/fread() on a web page that contains
Try this out:
http://www.checkupdown.com/status/E502.html
Robert Johnson wrote:
Hi all. I'm getting this error using Dreamweaver MX, php and mysql on a IIS
server over my intranet. I can't figure out what it means... it happens
when I try to connect to a table using php.
TIA,
Robert
--
PHP
You might consider using tmpnam() instead. tmpnam() doesn't give you a
file handle (like tmpfile() does), but rather a file name. Just pass it
a directory (like "/tmp") and a prefix to help identify it (can be "" ).
It returns the unique file's name, and you could open a file handle to
it with
You appear to have a ton of extra braces. I've modified your code below.
That should do it, though keep in mind that your HTML is faulty too,
though most browsers will probably tolerate it. :)
--Dave
Michelle Whelan wrote:
I am looking to display results of a query inside of an html table. Wh
Mike Delorme wrote:
Hello,
I am trying to write a script that conects to mysql, then SHA database. Then I need to list ALL the rows of table members. It sais there is a error on line 18. The while statement is on line 18, and I cant firgure out whats wrong with it:
$host = "localhost";
$uname =
You need to install the php-mysql rpm. You can get this on your RedHat CD,
or through apt-get:
apt-get install php-mysql
Get apt here: http://apt.freshrpms.net/
Does the PHP project ever plan to do something as impressive as CPAN so
users won't have to reinstall or recompile just to extend its
f
(eregi(" $data = eregi_replace("} else {
> $data = $base . $data;
>}
>$this->RESPONSE = $data;
>fclose($fp);
>return true;
> }
> ## END FUN
Jeremy,
LDAP authentication happens in two stages: connect and bind. The connect
stage is just establishing a connection with the LDAP server
(ldap_connect()). No username or password is necesary in this stage.
Once your connection is established, you attempt a bind (ldap_bind())to
verify a userna
On Wed, 2003-01-08 at 06:50, [EMAIL PROTECTED] wrote:
>
> i know this is a bit down the chain, but i'm trying to keep the message
> strings in tact
>
> but can't you set up your directory just like you set up your mysql Grants.
> I have a directory that the web user owns, who is in its own gr
On Tue, 2003-01-07 at 15:52, [EMAIL PROTECTED] wrote:
>
> I agree with this method. i have not yet seen an advantage of storing
> blobs in a database. Is there one? i'm sure those on this list would have
> an opinion if there was one. personally, i like storing all this stuff on
> the file sys
Rich,
When I do searches with multiple fields, I construct the SQL string on
the PHP side. You can do something like this:
$sql = "SELECT * FROM docmeta WHERE ";
if( $PartNumber )
$sql .= "PartNumber='$PartNumber'";
if( $Title )
$sql .= " AND Title='$Title'";
and so on...
That
This can be done using the 'timestamp' type for your column. Note that
this field will be updated to the current time any time the row is
modified (including when it is created).
An alternative is to do it on the scripting side with the MySQL NOW()
command like so:
INSERT INTO your_table (field1,
These two methods are nearly identical. Practically, you will probably
never see a performance difference. The time it takes to perform a query
is an order of magnitude greater than the time it takes to allocate
space for and iterate through an array. I would imagine that you will
never notice a di
Three words:
php dot net
--Dave
On Fri, 2002-12-06 at 23:19, Jason Wong wrote:
> On Saturday 07 December 2002 11:54, Dallas wrote:
> > hey, i'm just new to using php and mysql
> >
> > i would like to know how to do the following for a assignment of mine
> > (shopping site):-
> >
> > and if I cou
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
I don't see an easy way to do this in one SQL statement. But, the
following PHP does the trick for me (assuming MySQL):
// get the list of Y values
$r = mysql_query( "SELECT * FROM table GROUP BY Y" );
while( $y_val = mysql_fetch_array( $r ) )
$y_vals[] = $y_val['Y'];
// For each Y, fetch
I have a directory 'admin' that has been .htaccess'ed off. Ie, If you
point your browser at that directory, you will be prompted with an HTTP
authentication dialog. Nothing special about PHP or MySQL there. I like
the security that .htaccess and Apache give me.
Now, I have users in a MySQL table w
Tyler,
You probably need one or two of the following:
1. Put single-quotes around case in your SQL (where type like 'case')
2. Use wild-cards in your where statement (where type like '%case%')
Good luck!
--Dave
On Wed, 2002-11-06 at 23:31, Tyler Whitesides wrote:
> Hi,
> Sorry if this is ametu
When you redirect, you lose your variables. This means that you must
send them in some form to the other script. If you change your redirect
command to the following, you will see that $a gets transferred and
echoed in the second script as well as the first:
Header("Location: second.php?a=$a");
N
On Tue, 2002-10-15 at 15:31, [EMAIL PROTECTED] wrote:
> and the file copy method
> just seems to easy, it almost seems wrong ;-),
This is a feature that is pretty nice about MySQL. You cannot do this
with Postgres, which caused my quite a few nice headaches over the
summer. You must dump the tab
42 matches
Mail list logo