Auto Generate MySQL CRUD Statements?
Hi,
I recently moved from ColdFusion and Actionscript to AngularJS and PHP...
Im pretty new to phpStorm and absolutely love it. I do, however, find myself spending an enormous amount of time writing basic CRUD statements for PHP & and MySQL. Something like what's shown below. Is there any plug-in, wizard, or assistance system that phpStorm provides that would alleviate the horrible repetative nature of CRUD statements?
$quote_number = $request->quote_number;
$person_id = $request->person_id;
$employee_id = $request->employee_id;
$location = $request->location;
$sow = $request->sow;
$quote_date = $request->quote_date;
$quote_id = $request->quote_id;
$terms_id = $request->terms_id;
$statement = $db->prepare("UPDATE
quotations
SET
quote_number = :quote_number,
person_id = :person_id,
employee_id = :employee_id,
location = :location,
sow = :sow,
quote_date = :quote_date,
terms_id = :terms_id
WHERE
quote_id=:quote_id");
$statement->execute(array(
'quote_number'=>$quote_number,
'person_id'=>$person_id,
'employee_id'=>$employee_id,
'location'=>$location,
'sow'=>$sow,
'quote_date'=>$quote_date,
'terms_id'=>$terms_id,
'quote_id'=>$quote_id));
Please sign in to leave a comment.
Can this be helpful: http://stackoverflow.com/a/17881586/3020930 ?
Try this one if you are having trouble with CRUD in PHP and MySQL. The process depends on the method you are using. If you are using prepared statement then this one could be helpful.