Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Some variable problem
Old 09-18-2007, 10:05 PM Some variable problem
Skilled Talker

Posts: 65
Trades: 0
Hi the code below is in an array format.
PHP Code:
echo join(', '$sort_fields_w); 
i can display the value directly but what i want is to strore the join(', ', $sort_fields_w) in a variable called $val so i can display the value using echo $val; in other function. Any way on how i transfer the value from echo join(', ', $sort_fields_w); into the $val variable?


thanks
leolim is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-18-2007, 10:15 PM Re: Some variable problem
killdude69's Avatar
Average Talker

Posts: 24
Name: Brandon Miller
Trades: 0
I would help you, but I have no clue what the join() function does.
__________________
Huhh, well, you screwed up this time dumby.

Free PHP BBCode parser & inserter:
Please login or register to view this content. Registration is FREE
killdude69 is offline
Reply With Quote
View Public Profile
 
Old 09-19-2007, 08:04 AM Re: Some variable problem
Ultra Talker

Posts: 483
Trades: 0
$val = join(', ', $sort_fields_w);

No offence, but this is basic stuff. Even the page about the function on the PHP site shows this same kind of code.

Before going into array manipulation you really should learn and understand this kind of stuff, otherwise you'll never get far away from the forum...
__________________

Please login or register to view this content. Registration is FREE
TwistMyArm is offline
Reply With Quote
View Public Profile
 
Old 09-19-2007, 10:03 AM Re: Some variable problem
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Yea all it does is put the out put into a var.. take a guess from the rest of thePHP syntax
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 09-19-2007, 10:12 AM Re: Some variable problem
Novice Talker

Posts: 14
Name: Dmitri
Trades: 0
To display all elements of array $val, you should use loop:
PHP Code:
foreach($val as $tmp) { 
    echo 
$tmp " <br />";

Dknight is offline
Reply With Quote
View Public Profile
 
Old 09-20-2007, 04:24 AM Re: Some variable problem
Skilled Talker

Posts: 65
Trades: 0
hi
i know this will be a very funny question but plz help me with it. currently i had downloaded easyPHP 1.8 but when i try to use the
curl_init()
it prompts that my system does not have the library. what should i do to use the curl_init() function.
please guide me on the setup of the library on where should i get the library and where should i paste the file and so on...
thanks

Last edited by leolim; 09-20-2007 at 04:26 AM..
leolim is offline
Reply With Quote
View Public Profile
 
Old 09-20-2007, 05:20 AM Re: Some variable problem
Super Talker

Posts: 134
Trades: 0
right click on the black E down right below. go to configuration menu, PHP extenstions, check the php curl checkbox, click the aply button restart easy php
__________________

Please login or register to view this content. Registration is FREE

Check out the Facebook Clone build with Jcow SNS at
Please login or register to view this content. Registration is FREE
, it is free and it always will be
Falcone is offline
Reply With Quote
View Public Profile
 
Old 09-20-2007, 10:29 PM Re: Some variable problem
Skilled Talker

Posts: 65
Trades: 0
hihi
another problem occurs. the same thing which i use the easyPHP 1.8 and the database come out with the error

Fatal error: Maximum execution time of 30 seconds exceeded in

Iknow i need to set the variable but which variable in which folder i need to change?
i can`t find any folder related except the folder easyPHP1.8 after installing the easyPHP?

please tell me what should i do to fix the error in step by step.
thanks.

Last edited by leolim; 09-20-2007 at 10:30 PM..
leolim is offline
Reply With Quote
View Public Profile
 
Old 09-23-2007, 08:13 PM Re: Some variable problem
Skilled Talker

Posts: 65
Trades: 0
hi
could anyone help me to solve my problem above?

thanks
leolim is offline
Reply With Quote
View Public Profile
 
Old 09-24-2007, 08:19 AM Re: Some variable problem
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
I know this may sound harsh,

But easyPHP may be working right and all i dont now how much php you know and all just a guess, but it may be worth looking in to setting up a seperate apache server with php and fool around with that so when it is set up you understand how it works and also you can change any execution times necessary. so you learn were the important files are and how it works, and yes you can get away with installing apache on the same machine twice (set your 2nd install to this user only port 8080 and start manually to avoid port conflicts.)

But with the execution time you are giving it sounds like the server is having issues reaching the mysql server, was it working before you started debugging your script? if it was start looking in that and see if you changed any varible for mysql to connect and work.

but somewhere on your computer more in likely in your easyPHP folder there will be a file called php.ini

using notepad use find from the edit menu and look for mysql.connect_timeout

here is the mysql snippet from my php.ini that may help you under stand a little more.
Code:
[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect().  If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; at MYSQL_PORT.
mysql.default_port =

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password!  And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password =

; Maximum time (in seconds) for connect timeout. -1 means no limit
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
mysql.trace_mode = Off
Your mysql.connect_timeout is probably 30 instead of 60

Hth, Jon
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 09-24-2007, 09:28 AM Re: Some variable problem
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
I don't think it's problem is mysql related now.
The error message says "execution time"...

I've answered that question there:
http://www.webmaster-talk.com/the-da...e-problem.html

And leolim, open 1 thread per questions, and don't cross post them through multiple boards.
It's useless and it pollute the boards.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Some variable problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.63096 seconds with 12 queries