PHP 5.4 form action Old code > over PHP 7.0
- or -
Post a project like this- Posted:
- Proposals: 15
- Remote
- #2313242
- Awarded
Description
Part of code example to fix:
//function update table
function updateTable($table_name,$condtion=''){
global $link;
$query='';
$field=array();
$field_result=mysql_query("SELECT * FROM `$table_name`",$link);
$total_fields=mysql_num_fields($field_result);
$query.="UPDATE `$table_name` ";
while ($meta = mysql_fetch_field($field_result))
{
$field[]=$meta->name;
}
$i=0;
foreach($field as $value)
{
global $$value;
if(!empty($$value)){
if($i==0){
$query.="SET `".$value."`='".$$value."'";
$i=1;
}
else{
$query.=",`".$value."`='".$$value."'";
}
}
}
$query.=" WHERE ".$condtion;
mysql_query($query,$link);
echo mysql_error();
mysql_free_result($field_result);
}
//---- part of form action bellow = to edit ---- //
$total_child = "INSERT INTO profile_details_kids(KidFName, KidMName, KidLName, KidDOB, KidCountryBirth, KidTownBirth, KidEduLevel, CreatedDt, Approved, Active, IP, UsrId)
VALUES('".$_POST["kidFName[$i]"]."', '".$_POST["kidMName[$i]"]."', '".$_POST["kidLName[$i]"]."', '".$_POST["kidDOB"]."', '".$_POST["kidCountryBirth"]."', '".$_POST["kidTownBirth"]."', '".$_POST["kidEduLevel"]."', '".$CreatedDt."', 'Y', 'Y', '".$IP."', '".$UsrId."')";
mysqli_query($linkS, $total_child) or die("Error INSERT profile_details_KIDS: ".mysqli_error($linkS));
}
}
}else{
$inc =1; for($i=0;$i<=10;$i++){
$total_child = "UPDATE profile_details_kids
Tony J.
100% (2)New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Hi Tony,
Can you please give more specific explanation of this task? In fact something like:
1) How much PHP code customization you need in the project? I mean, you have posted just a part of the full task.
2) Is there your project running in live?
Thanks -
Hello Tony,
It seems there is an issue in the description of the project, first what you require is not clear, secondary. at one place you have used mysqli instead of mysql, so not clear whether your are using mysql_ or mysqli_. One more thing, the for loops end part is missing. If clarifications are provided then it will be much better. Below is the part of script which you pasted and which seems to have issue. Thank you
mysqli_query($linkS, $total_child) or die("Error INSERT profile_details_KIDS: ".mysqli_error($linkS));
}
}
}else{
$inc =1; for($i=0;$i<=10;$i++){
$total_child = "UPDATE profile_details_kids