Hi all
I need to compare values of multiple arrays, the tricky thing: I can't just
use array_diff, because I also need to count all the occurences and give
them back. The more tricky thing: It's a foreach loop through $arr[x
['comparable value'] while x is 1,4,3,6... so it's not that easy to comp
Patrick Fehr wrote:
> Hi all
>
>
> I need to compare values of multiple arrays
The obvious problem is, that I can't use array_count_values() because the
values are in different arrays, and array_count_values() refuses to compare
over different arrays :)
greets to all
patrick
--
Patrick Fehr
I have just changed to PHP 5 as I wanted to extend the functionality of one
of my projects to further use its OO. But I just discovered that one of the
extensions available under PHP 4+ isnt included in the same way,
The zip_open + other functions are not available under the configure
options f
I'm building a search function and I think most of the
search part is solid.
Now I'm trying to figure out the results part.
Since my results would return about 7 fields per
record, I'm thinking mysql_fetch_row over mysql
results works better ?
But I don't want every field from the row returned,
o
Stephen Craton wrote:
> I've been working on a script for a while now and it works perfectly on my
> local machine. I'm using a couple of classes, mainly my database and users
> classes.
> After logging in, I assign a session variable to the user's row in the
> database: $_SESSION['user'] = $db->
Nick Halstead wrote:
I have just changed to PHP 5 as I wanted to extend the functionality of one
of my projects to further use its OO. But I just discovered that one of the
extensions available under PHP 4+ isnt included in the same way,
The zip_open + other functions are not available under the
HI,
Does anybody know if its possible to execute a command through exec,
shell exec, system and if the program doesn't terminate in N seconds
returns control to PHP ?
Thanks in advance
Rui Francisco
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsu
This would be handled in your query, so get a SQL book or look into the mysql
documentation...
Look at the select statement, to request specific fields, as well as the Limit
keyword to return a certain number of results per page.
-B
- Original Message -
From: Stuart Felenstein <[EMAIL
--- [EMAIL PROTECTED] wrote:
> This would be handled in your query, so get a SQL
> book or look into the mysql documentation...
>
> Look at the select statement, to request specific
> fields, as well as the Limit keyword to return a
> certain number of results per page.
> -B
>
So there is no
> -Original Message-
> From: Stuart Felenstein [mailto:[EMAIL PROTECTED]
> Sent: 11 November 2004 11:32
> To: [EMAIL PROTECTED]
> Subject: [PHP] Looking for pointers to mysql functions
>
>
> I'm building a search function and I think most of the
> search part is solid.
>
> Now I'm try
Hello,
does anybody knows how to call a C function from a php code?
Thank you!! :)
-
Do you Yahoo!?
Check out the new Yahoo! Front Page. www.yahoo.com
--- Graham Cossey <[EMAIL PROTECTED]> wrote:
> Is this something like what you are after:
>
> $sql = "SELECT col1, col2, col3, col4 as colx, col5
> FROM my_table
> WHERE col2 LIKE '%$search%'
> ORDER BY col3
> LIMIT $from, $max_results";
>
> $result = mysql_que
- Original Message -
From: Stuart Felenstein <[EMAIL PROTECTED]>
Date: Thursday, November 11, 2004 7:13 am
Subject: Re: [PHP] Looking for pointers to mysql functions
>
> --- [EMAIL PROTECTED] wrote:
>
> > This would be handled in your query, so get a SQL
> > book or look into the mysq
--- Rayan Lahoud <[EMAIL PROTECTED]> wrote:
> does anybody knows how to call a C function from a php code?
Try this:
http://pear.php.net/package/Inline_C
Hope that helps.
Chris
=
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Febr
You must write a PHP extension which calls the function.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jason wrote:
Looks like you understand already. Did you have some broken code you
wanted help with?
yeah.. I should have posted it first. Here it is:
/* User Defined Variables */
$defined = array( "0" => "localhost",
"1" => "user",
"
Brad Pauly wrote:
should basic data validation come before a function call or be performed
within the function?
I would do the validation inside the function. This avoids repeating
the validation everywhere the function is called. It also makes the
function more self-contained. It expects a certain
Abhilash Kumar wrote:
I installed latest version of PHP from the source on a
AMD ATHELON64 system with REDHAT 9.0 installed with
apache server 2. There were no error upon running
"configure" or "make" or "make install" I have checked
the instalation procedures many times now but I get a
blank scree
Sorry, yeah it is a typo
Sebastian Mendel wrote:
Jason wrote:
Looks like you understand already. Did you have some broken code you
wanted help with?
yeah.. I should have posted it first. Here it is:
/* User Defined Variables */
$defined = array( "0" => "localhost",
Jerry Swanson wrote:
What variable "header" use? If I send something in header, what GLOBAL
variable header use?
do you mean $_SERVER ?
$_SERVER holds some header-information sent by the client to the webserver
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.
Jason wrote:
Looks like you understand already. Did you have some broken code you
wanted help with?
yeah.. I should have posted it first. Here it is:
/* User Defined Variables */
$defined = array( "0" => "localhost",
"1" => "user",
"
HI,
Does anybody know if its possible to execute a command through exec,
shell exec, system and if the program doesn't terminate in N seconds
returns control to PHP ?
Thanks in advance
Rui Francisco
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsu
Patrick Fehr wrote:
Hi all
I need to compare values of multiple arrays, the tricky thing: I can't just
use array_diff, because I also need to count all the occurences and give
them back. The more tricky thing: It's a foreach loop through $arr[x
['comparable value'] while x is 1,4,3,6... so it's not
Sebastian Mendel wrote:
Jason wrote:
Looks like you understand already. Did you have some broken code you
wanted help with?
yeah.. I should have posted it first. Here it is:
/* User Defined Variables */
$defined = array( "0" => "localhost",
"1" => "user",
Hi All,
I'm developing a small server application that accepts connections on a
socket and then launches an interactive session with the client.
The server needs to be able to accept N connections. This part is
working famously thanks to code I've borrowed and modified from:
http://www.zend.com
How do I su (switch user) to another account from the nobody in php? I
haven't got it to work, so I get the impression that it is either I'm doing
it all wrong in PHP script or that the nobody doesn't have the authority to
do so.
Have anyone who ever successfully do it please post a sample script
Well if you are using apache as your webserver you can use a module
which supports this feature... mod_chroot, mod_ruid or mod_suid2 is what
you want.
Or just as a suggestion if you don't want to change the running
environment of apache I recommend having your script set a flag (temp
file or s
On Thu, 11 Nov 2004 15:15:56 +0100, Ian Firla <[EMAIL PROTECTED]> wrote:
> The problem is the dialogue with the client. If I enter into a while
> loop then the whole script remains occupied and cannot accept new
> connections.
PHP doesn't have threads.. and that's what you would need to accept
mor
I should have specified that this is a shell script, not a web
application.
I have a listening process running. The listening process calls another
script once a connection is established. This is done via exec.
It works; however, I can't pass a resource directly to the other script.
Therefore,
Thanks Greg.
That is what I'm doing.
The problem remains passing a resource to the script executed by exec.
Ian
On Thu, 2004-11-11 at 08:45 -0600, Greg Donald wrote:
> On Thu, 11 Nov 2004 15:15:56 +0100, Ian Firla <[EMAIL PROTECTED]> wrote:
> > The problem is the dialogue with the client. If I
>From what I've seen, if someone mails me a correctly formatted message,
I get the title right, however something like a non-standard mail
clients does it, I get the =windows-1255 string you gave as the subject.
Do note: The standard name is ISO-8859-8-I. NOT windows-1255, which is a
nice micro$of
I've seen screenshots of websites using Live website rendered and
shown in an IFRAME scaled down to say.. 50%
.
IFRAME is your keyword I guess.
However, your idea is realy creative.
On Wed, 10 Nov 2004 13:39:00 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]>
wrote:
> Please Cc: me, as it's bee
I'm not certified expert ;-) but what I meant is
Do not use function that writes to the hardcoded global variables:
example:
function db() {
...
$GLOBALS['db']=x_open_something($GLOBALS['...'], ...);
...
}
This function is really... hm... not flexible enough ;-)
It can make
Hi,
Is it possible to evaluate a string passed to a script as an object?
If, for example, I have the following executing in my script:
$result = $player_1->execute_query();
// OR
$result = $player_2->execute_query();
If I pass a value to a script in the following manner, say:
$playername = $_G
That is exactly the type of example I was in need of. Thanks a ton.
Elixon wrote:
I'm not certified expert ;-) but what I meant is
Do not use function that writes to the hardcoded global variables:
example:
function db() {
...
$GLOBALS['db']=x_open_something($GLOBALS['...'], ...);
...
}
Ben Miller wrote:
edit
I hope this is not a stupid question, but I am learning how to work with
Arrays, and am having trouble figuring out how to move array values [the
whole array and all of it's values] from
page to page and/or store in a db.
Array Example");
echo ("");
for ($i=0; $i
echo (
In terms of performance which is faster.
mssql_fetch_array($var,mssql_assoc) or mssql_fetch_assoc()?
I read in the manual that mssql_fetch_array() isn't noticably slower
than mssql_fetch_row(), but I didn't see anything about
mssql_fetch_assoc() in terms of performance.
I was wondering if anybod
Alex Hogan wrote:
In terms of performance which is faster.
mssql_fetch_array($var,mssql_assoc) or mssql_fetch_assoc()?
I read in the manual that mssql_fetch_array() isn't noticably slower
than mssql_fetch_row(), but I didn't see anything about
mssql_fetch_assoc() in terms of performance.
I was wond
how come mysql_connect() doesn't work? What should i use instead to
get me connect MySql.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[snip]
how come mysql_connect() doesn't work? What should i use instead to
get me connect MySql.
[/snip]
Are you getting a specific error? Can you show us the code you are
using? What version of PHP? Without this we cannot help you.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe
Does anybody knows how to install a pear package. i have the inline_C package
that i want to install and use. And can i have some sample functions using this
package?
Thank you
-
Do you Yahoo!?
Check out the new Yahoo! Front Page. www.y
Do you really need to switch users or do you need to run something as
another user?
Try looking into setting up and using sudo.
Ian
On Thu, 2004-11-11 at 09:20 -0500, Scott Fletcher wrote:
> How do I su (switch user) to another account from the nobody in php? I
> haven't got it to work, so I g
On Thu, 11 Nov 2004 12:26:17 -0700, Jason <[EMAIL PROTECTED]> wrote:
> function db( $host, $user, $pass, $dbnam ) {
> $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
> @mysql_select_db( $dbnam )or die( mysql_error( $db ) );
> return $db;
> }
>
> function logs()
db( $defined[0], $defined[1], $defined[2], $defined[3] );
> which tells me that the $db handle is not being returned when called
> from the db() function from within the logs() function and I am not
> sure why?
it's being returned, you've just forgotten to assign it. add a "$db = "
to the beginn
Rick Fletcher wrote:
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
@mysql_select_db( $dbnam )or die( mysql_error( $db ) );
return $db;
}
function logs() {
global $defined;
db( $defined[9], $defined[1], $defined[2], $
* Thus wrote Jason:
> function db( $host, $user, $pass, $dbnam ) {
> $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
>@mysql_select_db( $dbnam )or die( mysql_error( $db ) );
> return $db;
> }
>
> function logs() {
> global $defined;
>
> db( $defined[9], $defin
I have a dynamically created image labeled:
stories & critiques.jpg
I have use url encode on it when saving it, and it is stored on the server
as:
stories+%26+crtitiques.jpg
[snip]
If I just put the path into the browser directly it also 404's
If I rename the file in any way that removes the % it
I hate posting all of that code, but for Greg's question... it does give
me the correct array data.
Jason wrote:
Rick Fletcher wrote:
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db
));
@mysql_select_db( $dbnam )or die( my
On Thu, 11 Nov 2004 12:42:44 -0700, Jason <[EMAIL PROTECTED]> wrote:
> There isnt an error at all.
How could there be an error? You're using @ to suppress nearly every
mysql function call. Makes it kind of hard to debug that way.
--
Greg Donald
Zend Certified Engineer
http://gdconsultants.com
Hello,
I would like to migrate my MySQL servers from 4.0 to 4.1.
As I use PHP as well as Java with these servers I wonder what PHP 4
version would be compatible with MySQL 4.1.
Has anyone used MySQL 4.1 with PHP yet?
I appreciate your thoughts.
Thanks.
--
PHP General Mailing List (http://www.php.
Hello all
I have a dynamically created image labeled:
stories & critiques.jpg
I have use url encode on it when saving it, and it is stored on the server
as:
stories+%26+crtitiques.jpg
I have an html block that calls the image
I get a 404
I know the path is right and spelling is correct
Greg Donald wrote:
On Thu, 11 Nov 2004 12:42:44 -0700, Jason <[EMAIL PROTECTED]> wrote:
There isnt an error at all.
How could there be an error? You're using @ to suppress nearly every
mysql function call. Makes it kind of hard to debug that way.
yep, you are right... I removed the @ for each o
Rick Fletcher wrote:
db( $defined[0], $defined[1], $defined[2], $defined[3] );
> which tells me that the $db handle is not being returned when called
> from the db() function from within the logs() function and I am not
> sure why?
it's being returned, you've just forgotten to assign it. add
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
@mysql_select_db( $dbnam )or die( mysql_error( $db ) );
return $db;
}
function logs() {
global $defined;
db( $defined[9], $defined[1], $defined[2], $defined[3] );
... do
[snip]
I would like to migrate my MySQL servers from 4.0 to 4.1.
As I use PHP as well as Java with these servers I wonder what PHP 4
version would be compatible with MySQL 4.1.
Has anyone used MySQL 4.1 with PHP yet?
[/snip]
PHP 4 is compatible with MySQL 4.1. My caution to you would be using
A
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
@mysql_select_db( $dbnam )or die( mysql_error( $db ) );
return $db;
}
function logs() {
global $defined;
db( $defined[9], $defined[1], $defined[2], $defined[3] );
... do
On Thu, 11 Nov 2004 02:51:54 -0800 (PST), Rayan Lahoud
<[EMAIL PROTECTED]> wrote:
Hello,
does anybody knows how to call a C function from a php code?
Thank you!! :)
http://us4.php.net/manual/en/function.system.php
--
Using M2, Opera's revolutionary e-mail client: http://
I migrated to MySQL 4.1 about a month ago. I had some issues with PHP
(running 4.3.6) communicating with MySQL because 4.1 implements a new
form of communication. As I recall, I had to do something with the
passwords in the grants table, but I forget what now. It's been working
fine since.
On
I think I know, You're probably using php 5. mysql module is not 'installed'
in it..
"Jay Blanchard" <[EMAIL PROTECTED]> a écrit dans le
message de news: [EMAIL PROTECTED]
[snip]
how come mysql_connect() doesn't work? What should i use instead to
get me connect MySql.
[/snip]
Are you getting a
You will need to use the old_password() function in MySQL 4.1 and above.
You can find out more at mysql.com
Jim
On Thu, 2004-11-11 at 15:58 -0500, Brent Baisley wrote:
> I migrated to MySQL 4.1 about a month ago. I had some issues with PHP
> (running 4.3.6) communicating with MySQL because 4.1
Um, I'll look into it. Thanks... Scott
"Jason" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well if you are using apache as your webserver you can use a module
> which supports this feature... mod_chroot, mod_ruid or mod_suid2 is what
> you want.
>
> Or just as a suggestion if y
Yea, switch users so I can do the chmod, chown, etc... Um, I'll look into
it.
Thanks,
Scott
"Ian Firla" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Do you really need to switch users or do you need to run something as
> another user?
>
> Try looking into setting up and using
The MySQL library for 4.1.x is mysqli_* ( http://www.php.net/mysqli ) ,
that's only works with PHP 5 as far as I know. The old MySQL library (
http://www.php.net/mysql ) Can be used with PHP 4 (any version), but it
won't be able to connect to MySQL with a user using the new password
system intr
On Nov 11, 2004, at 12:50 PM, Rayan Lahoud wrote:
Does anybody knows how to install a pear package. i have the inline_C
package that i want to install and use. And can i have some sample
functions using this package?
I believe the inline_c package is actually a pecl package
[pecl.php.net], howe
In my previous email OLDPASSWORD() should have been OLD_PASSWORD()
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have this strange problem.
If anyone enteres the letters 'nc ' that is N C and a space (eg typing Bobs
Inc or Hotsync etc) the server gives:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Now I suppose it could be
Hi,
I've a string where the output of route -n is in for example.
x.x.x.x 0.0.0.0 255.255.255.255 UH0 00 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 00 eth1
0.0.0.0 x.x.x.x 0.0.0.0 UG0 00 ppp0
The regular
Hi,
I have a weird problem with sessions on PHP 4.3.9 + Apache 1.3.33 in
Slackware, maybe someone could help me or have had the same problem. I'm
getting these messages in my logs:
PHP Warning: Unknown(): Failed to write session data (files). Please
verify that the current setting of session.sav
Jason Oakley wrote:
I have this strange problem.
If anyone enteres the letters 'nc ' that is N C and a space (eg typing Bobs
Inc or Hotsync etc) the server gives:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Now I sup
Hello,
Are there any free shopping carts out there that can handle the credit card
transaction? How do I get started here? Any help is greatly appreciated.
Thanks,
Jason Bourque
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
99% of shopping carts are able to handlel credit card transactions.
search "php shopping cart" on
google
freshmeat.net
hotscripts.com
I use most of the time osCommerce. More then happy.
Used several times X-Cart. They are good too, but not for free.
-afan
Jason Bourque wrote:
Hello,
Are there any f
On Friday 12 November 2004 00:50, [EMAIL PROTECTED] wrote:
> The regular expression is already working but how can I reduce the
> string to have then only 2 lines ?
Convert the string into an array using explode().
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Sy
I use this when submitting the data from the form (for jokes):
if ($submit)
{
$joke = nl2br($joke);
$dbcnx = @mysql_connect( "localhost", "root", "password");
mysql_select_db("movements");
$sql = "INSERT INTO jokes SET author='$author', joke='$joke', id='$id'";
mysql_query($sql);
echo "Thank you
On Friday 12 November 2004 04:49, Justin French wrote:
> What's the quickest way to add a space every four characters?
>
> Eg 123456789 becomes 1234 5678 9
No idea whether it's the quickest (in terms of cpu time):
$doo = '123456789';
$dah = preg_replace('/(\d{4})/', '\\1 ', $doo);
ec
Hi,
What's the quickest way to add a space every four characters?
Eg 123456789 becomes 1234 5678 9
TIA,
Justin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 13/11/2004, at 12:20 AM, Jason Wong wrote:
No idea whether it's the quickest (in terms of cpu time):
$doo = '123456789';
$dah = preg_replace('/(\d{4})/', '\\1 ', $doo);
echo $dah;
Quickest for me is more about lines of code and simplicity, so, thanks!!
Justin
--
PHP General Mailing L
On 12/11/2004, at 4:05 PM, Amanda Hemmerich wrote:
I did a search for this in the archive but didn't find anything.
Is there a way to preserve the format of text in a textbox that is
being
saved in a database and then pulled out and displayed? The people
entering the data want to keep their tabs
Justin French wrote:
Hi,
What's the quickest way to add a space every four characters?
Eg 123456789 becomes 1234 5678 9
Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I did a search for this in the archive but didn't find anything.
Is there a way to preserve the format of text in a textbox that is being
saved in a database and then pulled out and displayed? The people
entering the data want to keep their tabs and newlines, but right now,
that's not happening.
On Fri, 12 Nov 2004 15:41, Justin Baiocchi wrote:
> I use this when submitting the data from the form (for jokes):
>
> if ($submit)
> {
> $joke = nl2br($joke);
> $dbcnx = @mysql_connect( "localhost", "root", "password");
> mysql_select_db("movements");
> $sql = "INSERT INTO jokes SET author='$au
What web based software project management tool do you use to keep track of
projects, project tasks, customer requests, and bug reports? I need something
that would allow a customer to keep track of his/her project basically and to
use the application to submit bug requests, feature requests, an
On Friday 12 November 2004 06:36, Brent Clements wrote:
> I'm looking at replacing a home-grown solution I wrote in PHP a while back.
> I've done the google thing, but everything I've tried doesn't really sit
> well with me. So...now I'm turning to my peers for suggestions.
List what you tried. S
My host recently upgraded PHP. I had a script, download.php, that would
work like this
http://www.myhost.com/download.php/30/file.torrent
the download.php script would take the 30, look up the real filename in the
database, and readfile() it back. this was a great setup because the
browser just
Hi all,
Does anyone know if PHP has a library for getting the content of an XML file
like XML::Simple in perl?
In that perl library I can get the whole content of an XML file in a
reference to an array of arrays of arrays... with only 3 lines of code.
Is there such a simple method in PHP?
Thank
84 matches
Mail list logo