PHP Modification / MySQL
Bajet $30-250 USD
I have a small single PHP file snippet that loads CSV data into an OpenRealty database. This works fine, no problems at all. What I need is for a string replace to be considered before the data is entered.
Meaning, if the ID field has 50458510A, I need it to strip the ALPHA first so it shows up as 50458510 before adding it to the DB.
To make this easy, I have the script, the database and everything else already installed on my demo domain.
#### Summary portion of script #####
This is just a summary of the script area needing modification but basically it goes like this.
#### First, I have an array that matches the CSV file columns
$insert_fields=array(
"AGENTLIST"=>"0",
"ASSOC"=>"1",
"DESC"=>"2",
"CCR"=>"3",
"JLD"=>"4",
"ID"=>"5",
"CENTER"=>"6"
);
#### Next, I set the ID based on one of the column field values.
$sql="select * from ".$tablepref."listingsdb where listingsdb_id=".$data_elements[5];
$select=mysql_query($sql);
$rows=mysql_num_rows($select);
if($rows==1)
continue;
The whole script is not that long but it includes the other elements you may be curious about.
Dianugerahkan kepada:
15 pekerja bebas membida secara purata $31 untuk pekerjaan ini
I trust that the "stripped" generated ID field is not supposed to be used as the primary key....?