...

View Full Version : The proper way to split code on multiple lines



mymilkexpired
10-20-2003, 02:48 PM
$query = "INSERT INTO 2lssla (wfmcase, escdate, unitqty, company, priority, caselogger, description, status) VALUES ('{$_POST['wfmcase']}', '{date(m.d.y)}', '{$_POST['unitqty']}', '{$_POST['company']}', '{$_POST['priority']}', '{$_POST['caselogger']}', '{$_POST['description']}', '$_POST['status']}' )";

How would you break this on to 2 or 3 lines for readability?

Spookster
10-20-2003, 03:19 PM
This is my preferred way of making it more readable:




$query = "

INSERT INTO 2lssla (
wfmcase,
escdate,
unitqty,
company,
priority,
caselogger,
description,
status
)
VALUES (
'{$_POST['wfmcase']}',
'{date(m.d.y)}',
'{$_POST['unitqty']}',
'{$_POST['company']}',
'{$_POST['priority']}',
'{$_POST['caselogger']}',
'{$_POST['description']}',
'$_POST['status']}'
)
";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum