Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Explode Function Help, need help from you programmers!
it01y2
post Oct 31 2006, 01:00 PM
Post #1


Member [Level 1]
****

Group: Members
Posts: 65
Joined: 7-July 05
Member No.: 9,139



smile.gif Hi I am robert I need some help with some php coding. I am stuck with a explode function.

Here is the code:


$username = $check[uname];
$query="SELECT `buildings` FROM `authuser` WHERE `uname` = '$username'";
$result=mysql_query($query);
$result=mysql_result($result,0);
list($building1,$building2,$building3,$building4,$building5,$building6,$building7,$building8,$building9,$building10,)=explode('|',$result,'|',$position);

I want to explode a mysql field into two seperate fields so eg

building then position, building then position etc...
I want to create a variable for the building then the position eg $building1 then $postion1 then $building2 then $building2 etc...

Any ideas?
Go to the top of the page
 
+Quote Post
jlhaslip
post Oct 31 2006, 05:18 PM
Post #2


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 3,993
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



What does the data for $buildings look like?
Please post a sample for us to review. The explode() needs a unique character or set of characters to use as a delimiter.
PHP reference for the function is here: explode ()
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. PHP Function To Add Previous and Next Page Feature(2)
  2. Question Regarding Php Function(12)
  3. I Need Personal Advice And Possibly Any Inputs You May Have(3)
  4. Getting List Of Directories And Files Using Php(6)
  5. How To Use A Link To Call Function In Php?(8)
  6. Include File.php?id=something(13)
  7. How Good Is This Data Cleaning Function?(2)
  8. Genuine Help With Smtp And Php Mail() Function(3)
  9. Endif function?(6)
  10. Php - Forms, Date And Include(0)
  11. User Permission Function [php](3)
  12. How To Check If Fsockopen Function Is Enabled?(2)
  13. C++ Programmers(1)
  14. Helpful Registry Edit For Java Programmers(2)
  15. Some Programmers Definition(1)
  1. Two Really Good 2d Mmo Engines(1)
  2. Mail() Clone(5)
  3. Help: Disable All Buttons Inside A Div Element(8)
  4. Delphi(1)
  5. Php Variable Basics(9)
  6. Inkscape, A Open Source Vector App That Support Lot Function.(0)
  7. Arrays Outside A Function(3)
  8. The Best Zip Function(1)
  9. Programmers Galore!(2)
  10. Problem With Where Clause And Max Function(2)
  11. Php Explode Function Help(4)
  12. Editplus : Text/html/programmers Editor For Windows(5)
  13. Future Of Programming...(6)
  14. The Pc Games Programmers Encyclopedia 1.0(5)
  15. [php](simple) Using Functions To Combine Values In A Form(2)


 



- Lo-Fi Version Time is now: 5th September 2008 - 06:29 AM