php-general Digest 23 Jan 2004 13:22:54 -0000 Issue 2547
Topics (messages 175486 through 175511):
can't figure out this mysql error
175486 by: Chris W. Parker
175491 by: Jason Wong
Migrating OOP PHP4 codes to 5
175487 by: siamak
Re: PHP Equivalent of DBM Files
175488 by: Giz
pass by reference
175489 by: Kevin Waterson
175490 by: Justin French
175492 by: Kevin Waterson
175493 by: Tom Rogers
175494 by: Kevin Waterson
175495 by: Tom Rogers
How do I regain the ability to create databases (phpMyAdmin)?
175496 by: Freedomware
175501 by: Martin Luethi
Function for crypt and decript.
175497 by: francesco.automationsoft.biz
Re: Segmentation fault problem
175498 by: Martin Luethi
Weird problem with objects
175499 by: Mark Cubitt
175500 by: Stuart
Re: RE : [PHP] Weird problem with objects
175502 by: Stuart
Re: How do I regain the ability to create databases
175503 by: Freedomware
175504 by: Freedomware
Re: Suggestion on executing external programs from within php
175505 by: John Clegg
175506 by: Stuart
Importing Text into Database - Can you recommend a tutorial?
175507 by: Freedomware
175508 by: Jay Blanchard
175509 by: Jay Blanchard
175510 by: Humberto Silva
175511 by: Freedomware
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi.
I have a db class that accesses and executes querys as well as returns
the result (if you so choose to have it returned).
One method within this class is called query() (how genius!). It's
defined like so:
<?php
function query($sql, $current_line)
{
$this->Result = mysql_query($sql) or die($this->stop($current_line));
if(!$this->Result)
{
echo mysql_error();
}
$this->result_fields = mysql_num_fields($this->Result); // line 127
$this->result_rows = mysql_num_rows($this->Result); // line 130
}
?>
How is it possible that I'm getting the following errors?
Warning: mysql_num_fields(): supplied argument is not a valid MySQL
result resource in /home/cparker/www/schedulevark/lib/classes/db.php on
line 127
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /home/cparker/www/schedulevark/lib/classes/db.php on line
130
success!
I can't figure it out! It sure looks like a valid MySQL result to me! Oh
and I should mention that the query's I'm running are perfect and I can
run these two functions without error in another method (the one that
returns the results). That method is defined like so:
<?php
function get_query_results()
{
$Result_Arr = array();
////// THESE LINES WORK FINE!!!! BUT I DON'T WANT THEM HERE!
// // store the number of fields
// $this->result_fields = mysql_num_fields($this->Result);
//
// // store the number of rows
// $this->result_rows = mysql_num_rows($this->Result);
if($this->result_rows > 0)
{
while($line = mysql_fetch_array($this->Result, MYSQL_BOTH))
{
$Result_Arr[] = $line;
}
}
mysql_free_result($this->Result);
return $Result_Arr;
}
?>
The reason I don't want the two mysql counting functions in the second
method is because it forces me to execute the second method within my
page before I can access those values. Sometimes I need to access those
values but don't need to return a result so I'd like to be able to leave
that second step out.
Here is the original way they are used in my page (the way I don't
want):
<?php
$sql = "
SELECT field1
, field2
, field3
FROM thetable";
$object->query($sql, __LINE__);
$the_result = $object->get_query_results();
$the_result_Rows = $object->Result_rows;
$the_result_Fields = $object->Result_fields;
?>
Here is the way that I WANT it to work:
<?php
$sql = "
SELECT field1
, field2
, field3
FROM thetable";
$object->query($sql, __LINE__);
$the_result_Rows = $object->Result_rows;
$the_result_Fields = $object->Result_fields;
?>
Anyone have any ideas?
If I have not been verbose enough in this email let me know and I will
try to clarify.
Thanks,
Chris.
--- End Message ---
--- Begin Message ---
On Friday 23 January 2004 09:38, Chris W. Parker wrote:
> <?php
> function query($sql, $current_line)
> {
> $this->Result = mysql_query($sql) or die($this->stop($current_line));
>
> if(!$this->Result)
> {
> echo mysql_error();
> }
The if-clause will never be evaluated because if there had been an error your
program would have dieded on the previous line.
> How is it possible that I'm getting the following errors?
>
> Warning: mysql_num_fields(): supplied argument is not a valid MySQL
> result resource in /home/cparker/www/schedulevark/lib/classes/db.php on
> line 127
>
> Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
> resource in /home/cparker/www/schedulevark/lib/classes/db.php on line
> 130
> success!
>
> I can't figure it out! It sure looks like a valid MySQL result to me! Oh
I'm sure if php tells you it's invalid you can bet your *** it's invalid!
Check for errors and report with mysql_error() after _each_ and _every_ call
to the mysql_* functions.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If you sow your wild oats, hope for a crop failure.
*/
--- End Message ---
--- Begin Message ---
Hello,
1- Would someone please tell me if it is possible to
run OOP codes written for PHP4 on PHP5 yet? Or we need
to change codes?
2- Also what should we do? Continue with developing
OOP codes for PHP4 or wait for PHP5 to appear on
hosting servers (mostly using redhat distros) and then
develop for them or what?
What is your strategy?
Regards,
Mac
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
--- End Message ---
--- Begin Message ---
At the risk of being glib, DBM files.
http://www.php.net/manual/en/ref.dba.php
-----Original Message-----
From: gohaku [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 5:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Equivalent of DBM Files
Hi everyone,
I was just curious if there is an equivalent of DBM files used in Perl
scripts.
Thanks in advance.
-Gohaku
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
In a recent discussion about the MS terra server it was mentioned
this could not be done with PHP because the terraserver
" has special front-end code that allows images to be passed by reference,
so the image data goes directly from the database access back end to the
client browser, without having to be copied to and from an intermediate
middleware layer."
The implication is that the 'middle layer' (PHP) would slow things down
to an unusable state. so, when I extract an image from the database and
echo it to a webpage, is there any copying done? or is it a direct stream to the
webpage?
Kind regards
Kevin
--
______
(_____ \
_____) ) ____ ____ ____ ____
| ____/ / _ ) / _ | / ___) / _ )
| | ( (/ / ( ( | |( (___ ( (/ /
|_| \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
--- End Message ---
--- Begin Message ---
On Friday, January 23, 2004, at 03:17 PM, Kevin Waterson wrote:
The implication is that the 'middle layer' (PHP) would slow things down
to an unusable state. so, when I extract an image from the database and
echo it to a webpage, is there any copying done? or is it a direct
stream to the webpage?
I don't think you ever extract image data direct from a database and
echo it to a web (HTML) page do you? Typically you call a php script
which outputs the correct mimetype for the image, and passes the image
data through to the user agent.
In other words, you HTML source looks like this:
<img src='images.php?id=45'>
NOT
<img src='{RAW BINARY DATA HERE}'>
I don't know if this helps or not :)
Justin French
--- End Message ---
--- Begin Message ---
This one time, at band camp, Justin French <[EMAIL PROTECTED]> wrote:
> In other words, you HTML source looks like this:
>
> <img src='images.php?id=45'>
>
> NOT
>
> <img src='{RAW BINARY DATA HERE}'>
Yes, but how is this different from anything the terraserver is doing?
when the images.php script is called if would do something like
Select the image data from the database
header("Content-type: image/jpeg");
echo $row['image_data'];
surely this is as fast as we go, or is this adding an extra layer as
suggested in the first mail?
Kind regards
Kevin
--
______
(_____ \
_____) ) ____ ____ ____ ____
| ____/ / _ ) / _ | / ___) / _ )
| | ( (/ / ( ( | |( (___ ( (/ /
|_| \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
--- End Message ---
--- Begin Message ---
Hi,
Friday, January 23, 2004, 2:17:07 PM, you wrote:
KW> In a recent discussion about the MS terra server it was mentioned
KW> this could not be done with PHP because the terraserver
KW> " has special front-end code that allows images to be passed by reference,
KW> so the image data goes directly from the database access back end to the
KW> client browser, without having to be copied to and from an intermediate
KW> middleware layer."
KW> The implication is that the 'middle layer' (PHP) would slow things down
KW> to an unusable state. so, when I extract an image from the database and
KW> echo it to a webpage, is there any copying done? or is it a direct stream to the
webpage?
KW> Kind regards
KW> Kevin
KW> --
KW> ______
KW> (_____ \
KW> _____) ) ____ ____ ____ ____
KW> | ____/ / _ ) / _ | / ___) / _ )
KW> | | ( (/ / ( ( | |( (___ ( (/ /
KW> |_| \____) \_||_| \____) \____)
KW> Kevin Waterson
KW> Port Macquarie, Australia
What does the image tag look like on the request to the terra server ?
php can output the stream without having to save it to a file first if
that is what is worrying you.
--
regards,
Tom
--- End Message ---
--- Begin Message ---
This one time, at band camp, Tom Rogers <[EMAIL PROTECTED]> wrote:
> php can output the stream without having to save it to a file first if
> that is what is worrying you.
That was sorta my concern, but not so much as a file, does it copy to
memory anywhere, or, is it a direct stream to the browser?
Kind regards
Kevin
--
______
(_____ \
_____) ) ____ ____ ____ ____
| ____/ / _ ) / _ | / ___) / _ )
| | ( (/ / ( ( | |( (___ ( (/ /
|_| \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
--- End Message ---
--- Begin Message ---
Hi,
Friday, January 23, 2004, 3:18:06 PM, you wrote:
KW> This one time, at band camp, Tom Rogers <[EMAIL PROTECTED]> wrote:
>> php can output the stream without having to save it to a file first if
>> that is what is worrying you.
KW> That was sorta my concern, but not so much as a file, does it copy to
KW> memory anywhere, or, is it a direct stream to the browser?
KW> Kind regards
KW> Kevin
I am pretty sure mysql cannot do that yet and PHP has to put it to
memory first.
--
regards,
Tom
--- End Message ---
--- Begin Message ---
I've finally got both PHP and MySQL up and running, and I've learned how
to create new users and databases (at least the basics).
But I was told I should add a password to root/localhost, and that's
been a major pain in the butt. First, it knocked out phpMyAdmin. Then I
learned how to edit a file (phpMyAdmin.config.inc, or something like
that), which restored phpMyAdmin. But I next discovered that I can no
longer create databases.
When I open up phpMyAdmin, near the top of the page is a function for
creating new databases. It now says "No Privilieges," just under "Create
New Database."
I tried to retrace my steps in creating a password. I clicked on
Privileges, then clicked Edit in the root/localhost row.
Then I went down to where it says "Change Password," clicked the
Password radio button and typed in my password twice. I don't think I
did anything else.
So why would that knock out my databases? More important, how do I get
them back?
Thanks.
--- End Message ---
--- Begin Message ---
check if the user you defined in phpMyAdmin/config.inc.php
($cfg['Servers'][$i]['user'] = ???)
has the right to create new databases
(db: mysql / table: user / field: Create_priv='Y')
restart the mysql-server after altering the database mysql
g. martin luethi
Fri, 23 Jan 2004 01:26:46 -0800 Freedomware <[EMAIL PROTECTED]>:
I've finally got both PHP and MySQL up and running, and I've learned how
to create new users and databases (at least the basics).
But I was told I should add a password to root/localhost, and that's
been a major pain in the butt. First, it knocked out phpMyAdmin. Then I
learned how to edit a file (phpMyAdmin.config.inc, or something like
that), which restored phpMyAdmin. But I next discovered that I can no
longer create databases.
When I open up phpMyAdmin, near the top of the page is a function for
creating new databases. It now says "No Privilieges," just under "Create
New Database."
I tried to retrace my steps in creating a password. I clicked on
Privileges, then clicked Edit in the root/localhost row.
Then I went down to where it says "Change Password," clicked the
Password radio button and typed in my password twice. I don't think I
did anything else.
So why would that knock out my databases? More important, how do I get
them back?
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi all,
are in PHP, functions for crypt and decrypt string?
I would to use this function in my script in PHP, how can I use this?
I need of an example for use this and a list of this function.
Thanks in advance.
--- End Message ---
--- Begin Message ---
the function who is causing the seg fault is preg_match_all
maybe this helps (http://bugs.php.net/bug.php?id=20698):
[28 Nov 2002 6:26am EST] thingol at mail dot ru
If the text for preg_match_all is bigger than some value, many regexp
constructions causes php to terminate.
This code crashes php (on win32 only):
<?
$thi = str_repeat("aaaaaaa a aa aa aa\n", 1000);
preg_match_all("/(.|\n)*/",$thi,$vars);
?>
[28 Nov 2002 7:06am EST] [EMAIL PROTECTED]
Not really a PHP bug; bug is in the PCRE library itself
and is because you are asking it to capture a very large
number of individual character matches.
Increasing your stack size might help (ulimit).
g. martin luethi
Thu, 22 Jan 2004 14:20:56 -0500 "E. Stuart Hicks" <[EMAIL PROTECTED]>:
Please disregard my last post - I'd switched Apache back from the debug
module for the night and forgotten to turn it back on.
I've attached the full trace but here's the main part:
(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
$4 = 0xffffffff7bb69250 "preg_match_all"
(gdb) frame 8
#8 0xffffffff7baeabe4 in execute (op_array=0x1003a07d0) at
/root/build/php-4.3.4/Zend/zend_execute.c:1660
1660
zend_execute(EG(active_op_array) TSRMLS_CC);
(gdb) frame 9
#9 0xffffffff7baeabe4 in execute (op_array=0x1003af0c0) at
/root/build/php-4.3.4/Zend/zend_execute.c:1660
1660
zend_execute(EG(active_op_array) TSRMLS_CC);
(gdb) frame 10
#10 0xffffffff7baeabe4 in execute (op_array=0x10038f230) at
/root/build/php-4.3.4/Zend/zend_execute.c:1660
1660
zend_execute(EG(active_op_array) TSRMLS_CC);
(gdb) frame 11
#11 0xffffffff7bacde24 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at /root/build/php-4.3.4/Zend/zend.c:884
884 zend_execute(EG(active_op_array) TSRMLS_CC);
(gdb) frame 12
#12 0xffffffff7ba6dd08 in php_execute_script
(primary_file=0xffffffff7fffef20)
at /root/build/php-4.3.4/main/main.c:1729
1729 retval = (zend_execute_scripts(ZEND_REQUIRE
TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) ==
SUCCESS);
Stu
-----Original Message-----
From: E. Stuart Hicks [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 2:07 PM
To: 'Martin Luethi'; [EMAIL PROTECTED]
Subject: RE: [PHP] Segmentation fault problem
I still can't access anything on bugs.php.net so I'm not sure exactly what
you need. I grabbed all of the execute() frames, though, and ran that print
function and got this:
(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
Attempt to extract a component of a value that is not a structure.
(gdb) frame 6
#6 0xffffffff7babef00 in execute () from /home/httpd/modules/libphp4.so
(gdb) frame 7
#7 0xffffffff7babf244 in execute () from /home/httpd/modules/libphp4.so
(gdb) frame 8
#8 0xffffffff7babf244 in execute () from /home/httpd/modules/libphp4.so
(gdb) frame 9
#9 0xffffffff7babf244 in execute () from /home/httpd/modules/libphp4.so
(gdb) frame 10
#10 0xffffffff7babf244 in execute () from /home/httpd/modules/libphp4.so
Does this help?
Stu
-----Original Message-----
From: Martin Luethi [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 2:24 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Segmentation fault problem
each php function is executed by the internal function "execute()"
please include the details about this frames also (configure php with
--enable-debug first) e.g.:
(gdb) frame 6
output...
(gdb) print (char *)(executor_globals.function_state_ptr->function)-
common.function_name
output...
with this information you can see which php-command causing the seg fault
-> http://bugs.php.net/bugs-generating-backtrace.php
g. martin luethi
Program received signal SIGSEGV, Segmentation fault.
0xffffffff7bacedcc in zend_parse_arg_impl (arg=0x1003853c0,
va=0xffffffff7ffe3a88, spec=0xffffffff7ffe3a58)
at /root/build/php-4.3.4/Zend/zend_API.c:259
259 *p =
Z_LVAL_PP(arg);
(gdb) bt
#0 0xffffffff7bacedcc in zend_parse_arg_impl (arg=0x1003853c0,
va=0xffffffff7ffe3a88, spec=0xffffffff7ffe3a58)
at /root/build/php-4.3.4/Zend/zend_API.c:259
#1 0xffffffff7bacfa54 in zend_parse_arg (arg_num=4, arg=0x1003853c0,
va=0xffffffff7ffe3a88,
spec=0xffffffff7ffe3a58, quiet=0) at
/root/build/php-4.3.4/Zend/zend_API.c:439
#2 0xffffffff7bacff40 in zend_parse_va_args (num_args=0,
type_spec=0xffffffff7bb6906c "ll",
va=0xffffffff7ffe3a88, flags=0) at
/root/build/php-4.3.4/Zend/zend_API.c:524
#3 0xffffffff7bad032c in zend_parse_parameters (num_args=4,
type_spec=0xffffffff7bb69068 "ssz|ll")
at /root/build/php-4.3.4/Zend/zend_API.c:551
#4 0xffffffff7b9493cc in php_pcre_match (ht=4, return_value=0x1008c4c00,
this_ptr=0x0, return_value_used=0,
global=1) at /root/build/php-4.3.4/ext/pcre/php_pcre.c:375
#5 0xffffffff7b94a464 in zif_preg_match_all (ht=4,
return_value=0x1008c4c00, this_ptr=0x0, return_value_used=0)
at /root/build/php-4.3.4/ext/pcre/php_pcre.c:608
#6 0xffffffff7baea870 in execute (op_array=0x1008ac610) at
/root/build/php-4.3.4/Zend/zend_execute.c:1616
#7 0xffffffff7baeabe4 in execute (op_array=0x100884bd0) at
/root/build/php-4.3.4/Zend/zend_execute.c:1660
#8 0xffffffff7baeabe4 in execute (op_array=0x1003a07b0) at
/root/build/php-4.3.4/Zend/zend_execute.c:1660
#9 0xffffffff7baeabe4 in execute (op_array=0x1003af0a0) at
/root/build/php-4.3.4/Zend/zend_execute.c:1660
#10 0xffffffff7baeabe4 in execute (op_array=0x10038f220) at
/root/build/php-4.3.4/Zend/zend_execute.c:1660
#11 0xffffffff7bacde24 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at /root/build/php-4.3.4/Zend/zend.c:884
#12 0xffffffff7ba6dd08 in php_execute_script
(primary_file=0xffffffff7fffef30)
at /root/build/php-4.3.4/main/main.c:1729
#13 0xffffffff7baf3914 in php_handler (r=0x10037df10)
at /root/build/php-4.3.4/sapi/apache2handler/sapi_apache2.c:537
#14 0x00000001000ac8a0 in ap_run_handler ()
#15 0x00000001000ad798 in ap_invoke_handler ()
#16 0x000000010007b6d0 in ap_process_request ()
#17 0x00000001000712e4 in ap_process_http_connection ()
#18 0x00000001000c55b8 in ap_run_process_connection ()
#19 0x00000001000c5c18 in ap_process_connection ()
#20 0x00000001000a8e28 in child_main ()
#21 0x00000001000a9030 in make_child ()
#22 0x00000001000a92a4 in startup_children ()
#23 0x00000001000a9da8 in ap_mpm_run ()
#24 0x00000001000b79d8 in main ()
(gdb) quit
[EMAIL PROTECTED] httpd]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
hi,
I have a shopping cart I'm having probs with.
I have a cart class that starts like this:
<CODE>
require_once("class_database.php"); // Database Class
require_once("class_accessory.php"); // Accessory Class
require_once("class_order.php"); // Order Class
class cart
{
var $database;
var $accessory;
var $order;
function cart() {
$this->$database = new database();
$this->$accessory = new accessory();
$this->$order = new order();
} // end function cart
</CODE>
and has a line like this:
<CODE>
$price = $this->$accessory->get_accessoryPrice("$key");
</CODE>
there is a get_accessoryPrice function in the accessory class,
but it won't work unless I use this line instead:
<CODE>
$price = $this->$$this->$accessory->get_accessoryPrice("$key");
</CODE>
This makes no sense to me what so ever, so can anybody shed some light on it
for me.
I'm prob just making a silly mistake but any help would be very much
appreciated.
Thanks in advance
Regards
Mark Cubitt
--- End Message ---
--- Begin Message ---
Mark Cubitt wrote:
$this->$database = new database();
$this->$accessory = new accessory();
$this->$order = new order();
These should be...
$this->database = new database();
$this->accessory = new accessory();
$this->order = new order();
You don't want the $ unless $database, $accessory and $order are strings
containing the class attribute names.
Additionally, you might want to assign the reference of the new objects
otherwise PHP will create a new object and then make a copy of it - not
very efficient. Like so...
$this->database = & new database();
$this->accessory = & new accessory();
$this->order = & new order();
--
Stuart
--- End Message ---
--- Begin Message ---
Vincent DUPONT wrote:
what do you mean by this :Additionally, you might want to assign the reference of the
new objects
otherwise PHP will create a new object and then make a copy of it - not
very efficient. Like so...
$this->database = & new database();
$this->accessory = & new accessory();
$this->order = & new order();
The = operator makes a copy of the right side and puts it into the left
side. So the "new database()" bit will create a new object of type
database. The = operator will then make a copy of that object and put it
into $this->database. So it's actually creating 2 database objects one
of which will get deleted at the end of the function.
By assigning the reference (that's what the & gets) only one object is
created. Does that make sense now?
--
Stuart
--- End Message ---
--- Begin Message ---
Martin Luethi wrote:
check if the user you defined in phpMyAdmin/config.inc.php
($cfg['Servers'][$i]['user'] = ???)
has the right to create new databases
(db: mysql / table: user / field: Create_priv='Y')
restart the mysql-server after altering the database mysql
Hmmmm... I'm a little confused. I don't find that particular code in my
phpMyAdmin config file. But I suspect I may have done an unorthodox
maneuver.
If I remember correctly, it instructed me to replace "user" with my user
name on line 81 (see below) and type in a password on the next line.
* * * * * * * * * *
4.3.0)
$cfg['Servers'][$i]['controluser'] = ''; // MySQL control
user settings
// (this user must
have read-only
$cfg['Servers'][$i]['controlpass'] = ''; // access to the
"mysql/user"
// and "mysql/db"
tables)
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication
method (config, http or cookie based)?
[LINE 81] $cfg['Servers'][$i]['user'] = ''; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password
(only needed
// with 'config'
auth_type)
$cfg['Servers'][$i]['only_db'] = ''; // If set to a
db-name, only
* * * * * * * * * *
HOWEVER, it said the better method was to type in either "http" or (I
can't remember the second choice offhand). I think I did it on line 133
(see below.
$cfg['Servers'][$i]['controlpass'] = '';
[LINE 133] $cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = 'root';
* * * * * * * * * *
It sounds like I need to go back and change these two lines:
[LINE 81] $cfg['Servers'][$i]['user'] = ''; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password
(only needed
// with 'config'
inserting my username ("root") between the first = '';
then typing in my password between the next = '';
Then I need to go back and delete http; does that sound right?
I copied the original config file, so I could start from scratch.
Thanks.
--- End Message ---
--- Begin Message ---
Sheez, maybe you fixed it already...
I typed in the username and password, but did NOT delete http on line
133. I saved the page, but didn't restart MySQL, and it still works - I
think.
I haven't created a new database yet, but it's inviting me to!
Thanks for the tip.
--- End Message ---
--- Begin Message ---
Hi Stuart,
I have finally had a chance to test your suggestion and I am still
getting a browser timeout ?
The 1st program runs to completion even though the broswer times out. So
it doesn't execute the second program :-(
I have also tried....
`/usr/local/bin/process_file file1 &`
exec('/usr/local/bin/process_file file1 &')
Any ideas??
John
Stuart wrote:
John Clegg wrote:
I would like to be able to execute 2 system calls simultaneously. I
am not interested in the output and I would like to do the equivalent
of a fork as these programs take a long time.
system('/usr/local/bin/process_file file1');
system('/usr/local/bin/process_file file2');
system('/usr/local/bin/process_file file1 &');
system('/usr/local/bin/process_file file2 &');
Should work in theory. Haven't test it though.
--- End Message ---
--- Begin Message ---
John Clegg wrote:
I have finally had a chance to test your suggestion and I am still
getting a browser timeout ?
The 1st program runs to completion even though the broswer times out. So
it doesn't execute the second program :-(
I have also tried....
`/usr/local/bin/process_file file1 &`
exec('/usr/local/bin/process_file file1 &')
Any ideas??
Yup. Having checked the system function in the manual
(http://php.net/system), it says this...
"Note: If you start a program using this function and want to leave it
running in the background, you have to make sure that the output of that
program is redirected to a file or some other output stream or else PHP
will hang until the execution of the program ends."
So try this...
system('/usr/local/bin/process_file file1 > /dev/null &');
system('/usr/local/bin/process_file file2 > /dev/null &');
--
Stuart
--- End Message ---
--- Begin Message ---
I'm wading through some of the MySQL literature (whew!), but I'm looking
for the quickest way to create some tables and get them online.
I just downloaded a software program called EMS MySQL Manager, which
appears to work well with phpMyAdmin and makes some functions even
easier. Especially useful is a function that imports text from another
file, such as a spreadsheet.
I haven't been able to finish an import yet, because I'm still learning
how to make the tables to import it into; all of my tables have errors
of one kind or another.
I just wondered if anyone on this list is aware of a particularly
helpful tutorial or strategy for doing this sort of thing - or do you
just have to wade through all the tutorials and construct your tables,
one row/column/function at a time? I have a number of spreadsheet
databases, and I'm just looking for the quickest way to get them into a
MySQL/PHP database.
--- End Message ---
--- Begin Message ---
[snip]
I have a number of spreadsheet databases, and I'm just looking for the
quickest way to get them into a MySQL/PHP database.
[/snip]
If they (the spreadsheets) are really set up like databases then you can
save them as CSV files and import them directly with very little pain.
--- End Message ---
--- Begin Message ---
[snip]
[snip]
I have a number of spreadsheet databases, and I'm just looking for the
quickest way to get them into a MySQL/PHP database.
[/snip]
If they (the spreadsheets) are really set up like databases then you can
save them as CSV files and import them directly with very little pain.
[/snip]
Ooops, sorry. Google for 'import CSV into MySQL' or hit the MySQL web
site
--- End Message ---
--- Begin Message ---
> I have a number of spreadsheet databases, and I'm just looking for the
> quickest way to get them into a MySQL/PHP database.
Hi,
You can pick the headers from the speadsheets to construct the tables,
export from the spreadsheets to .csv and import it to the new tables
....
Humberto Silva
World Editing
Portugal
-----Original Message-----
From: Freedomware [mailto:[EMAIL PROTECTED]
Sent: sexta-feira, 23 de Janeiro de 2004 12:42
To: [EMAIL PROTECTED]
Subject: [PHP] Importing Text into Database - Can you recommend a
tutorial?
I'm wading through some of the MySQL literature (whew!), but I'm looking
for the quickest way to create some tables and get them online.
I just downloaded a software program called EMS MySQL Manager, which
appears to work well with phpMyAdmin and makes some functions even
easier. Especially useful is a function that imports text from another
file, such as a spreadsheet.
I haven't been able to finish an import yet, because I'm still learning
how to make the tables to import it into; all of my tables have errors
of one kind or another.
I just wondered if anyone on this list is aware of a particularly
helpful tutorial or strategy for doing this sort of thing - or do you
just have to wade through all the tutorials and construct your tables,
one row/column/function at a time? I have a number of spreadsheet
databases, and I'm just looking for the quickest way to get them into a
MySQL/PHP database.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Jay Blanchard wrote,
"Ooops, sorry. Google for 'import CSV into MySQL' or hit the MySQL web
site"
Humberto Silva wrote:
You can pick the headers from the speadsheets to construct the tables,
export from the spreadsheets to .csv and import it to the new tables
Wow, thanks for the tips. I wasn't even aware of CSV - something that
will be very useful for me.
--- End Message ---