Jump to content

edlentz

Members
  • Posts

    11
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

edlentz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ginerjm Thank you for all your help in guiding me toward my goal. I do not believe I asked for anyone to do this for me. Ignace Yes the tftp server is on the same server as the PHP code. I will check out those functions. Thanks
  2. I have not explained the ful scope of my project. What I need is to create these config files for the phones on a LAMP based VoIP phone system. the installer needs to be able to "create" the templates and then assign them to the phone files. ALL the programming for the phone system is done from a webserver on the phone system itself. The phones when they boot up look for a TFTP server and query it for the file based on the MAC address of the phone. The phone then downloads the file and is configured by that file.
  3. ginerjm, I do have some limited experience in setting up a dB and some PHP writing. I will take your comments to heart and start on the process of designing it and then implementing it. I was looking for some guidance for just manipulating and editing a text file. But clearly that is getting the cart before the horse. Thank you
  4. I need to create config files for IP based phones. There are several different models from the same manufacturer. The file structure is pretty simple for all models, just some differences in how many buttons, etc. IE: Button6 = BLF Button6value = 103 etc. I want to start out with a template of ALL the different settings an use PHP to change the variables. I also need to inject a username & password into the file for each specific phone with the name of the file being the MAC address of the phone. I know some PHP, but this is beyone my skill set. Can anyone provide a simple example of how I can do this ? What I have to work with is a LAMP system based on Centos6. Thanks in advance for any help
  5. Strange When I ran your code I got a blank screen and nothing in the table. The first line item the xxx.9001 is the kit number that those individual parts are a part of. I think I can live with that, but not what I was looking for. But close except that on my machine it didn't work at all. wierd.
  6. I appreciate what you have done Yesideez, but not sure why. I am wanting to show the table info with OpenOffice Base forms once I get the csv into MySql. Getting it there is the issue. I have or gould have lines that would only have 1 column which could be ignored, and sometimes a description that has an apostrophe , and also I need to strip the all the $ signs out of the file. Thanks!
  7. Thanks for the reply Barry. I tried your code with no results at all. Any other suggestions? Thanks
  8. Hi barand, I would use two tables if Icould. The original csv file is generated by a quote system that automatically generates all that is needed. I am trying to get it into my Db and then manipulate it for my own purposes.
  9. Thanks for the reply! I thought the third one would be tough to explain, I'll try again with an example: This is the way I get it, and the way I want it: 580.9001 ,Inter-Tel CS-5200 System with 5 Model 8520 Digital Endpoints,1,, , - Digital Endpoint Module (DEM16) (580.2200),1, , , - Inter-Tel 5000 BVM License Single Port (840.0411),4, , , - Inter-Tel 5000 Base System Chassis (580.1000),1, , , - Inter-Tel CS-5200/5400 Compact Flash Card - 512 MB (841.0274),1, , , - Inter-Tel DE-5200 Digital Expansion Interface (DEI) (580.1001),1, , , - License Inter-Tel 5000 Software v1.2 (840.0456),1, , , - License Inter-Tel 5200 Base (840.0238),1, , , - License Key for Inter-Tel 5000 (841.0219),1, , , - License for First Digital Endpoint Interface to Operate (840.0409),1, , , - Model 8520 - 2 Line Display Digital Endpoint (550.8520),5, , , - Processor Module 1 (PM-1) (580.2000),1, , , - Software CD for Inter-Tel 5000 v1.2 (841.0361),1, , , - Software Site License Kit (999.9000),1, , 813.1814 ,DEM Cable Adapter (quad RJ-45 to Amp) 15ft,1,, 550.8400 ,Model 8400 - Personal Computer Data Port Module (PCDPM),, This is the way it "sometimes gets into the MySql table" , - Model 8520 - 2 Line Display Digital Endpoint (550.8520),5, , , - Processor Module 1 (PM-1) (580.2000),1, , , - Software CD for Inter-Tel 5000 v1.2 (841.0361),1, , , - Software Site License Kit (999.9000),1, , 813.1814 ,DEM Cable Adapter (quad RJ-45 to Amp) 15ft,1,, 550.8400 ,Model 8400 - Personal Computer Data Port Module (PCDPM),, 580.9001 ,Inter-Tel CS-5200 System with 5 Model 8520 Digital Endpoints,1,, In the first line of the first example, the line describes the "Kit" that is comprised of the items following without a first column entry. So if the table has the info in the second example then when I need to use it, then it makes no sense.
  10. I have a small PHP script that I need help with. It goes something like this: ? //connect $db = mysql_pconnect($dbhost,$dbuser,$dbpass); mysql_select_db("$dbname",$db); $fcontents = file ('./tawas.csv'); # expects the csv file to be in the same dir as this script for($i=0; $i<sizeof($fcontents); $i++) { $line = trim($fcontents[$i]); $arr = explode(",", $line); $sql = "insert into temp_proposal_parts values ('". implode("','", $arr) ."')"; mysql_query($sql); echo $sql ."<br>\n"; if(mysql_error()) { echo mysql_error() ."<br>\n"; } } ?> So here's my problems: 1. The csv file will have many lines with 5 columns which matches the table I am importing to. But, there will be several lines that only have one column. Those lines I can do without. How can I modify the csv file to get rid of those lines in my PHP script. 2. Within one of the lines/columns similar to this one: 580.8001 ,Administrator's Guide Inter-Tel 5000,1,25.00,25.00 The ' in the second column stops the input for that line. If I manually remove the ' and run the script again it goes fine. 3. Finally, the csv file has just a couple of dozen lines, and then I manually remove or change the items above the import runs fine with one exception. Sometimes the ORDER of the lines are goofed up. Mostly the first line will have a Kit information, and for some undetermined # of lines below it the items in the kit are listed. If the order is goofed up, the listing of all the items in the list will make no sense. I am running PHP 4 and MySql 4.1 Can someone give me a hand here?? Thanks Alot!
  11. I need to export a table and I cna't seem to get it right. The format I need is: CSV with all fields enclosed with "" and null or empty fields with a 0 or o in them. Can this be done through a query? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.