Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

take the form and loop through an array to save all values in the form. code: query ( $sql ) ; $database - > bind

take the form and loop through an array to save all values in the form.
code:
query($sql);
$database->bind(":id", $id);
$database->execute();
$rows = $database->object();
foreach($rows as $key=>$val){echo $val ."
";}
//for loop for the form
/*
echo "saved. please make sure that the informztion is correct.
";
echo "$id
";
echo "$JobNumber
";
echo "$MatDesc
";
echo "$Contact
" ;
echo "$ContactNo
" ;
echo "$MatListLoc
" ;
echo "$Driver
" ;
echo "$jobStatus
" ;*/
/* THIS PART WORKS
//foreach row to be saved, if there is a :
$database= new database();
$sql="UPDATE jobmat.details SET id=:id,
JobNumber=:JobNumber,
jobName=:jobName,
jobAddress=:jobAddress,
MatDesc=:MatDesc,
Contact=:Contact,
ContactNo=:ContactNo,
MatListLoc=:MatListLoc,
Driver=:Driver,
jobStatus=:jobStatus
where id=:id";
$database->query($sql);
$database->bind(":id",$id);
$database->bind(":JobNumber",$JobNumber);
$database->bind(":jobName",$jobName);
$database->bind(":jobAddress",$jobAddress);
$database->bind(":MatDesc",$MatDesc);
$database->bind(":Contact",$Contact);
$database->bind(":ContactNo",$ContactNo);
$database->bind(":MatListLoc",$MatListLoc);
$database->bind(":Driver",$Driver);
$database->bind(":jobStatus",$jobStatus);
$database->execute();
*/
echo "not correct?Go back to the form
";
echo "Main Page";
?>
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

Show that sup{1 - 1/n : n N} = 1.

Answered: 1 week ago

Question

Prepare an electronic rsum.

Answered: 1 week ago

Question

Strengthen your personal presence.

Answered: 1 week ago

Question

Identify the steps to follow in preparing an oral presentation.

Answered: 1 week ago