Make long line of code more readable
Posted: Thu Jan 08, 2015 9:42 am
I have a long line of code, a SQL statement to be exact that needs to be shortened down to be readable, but being new to PHP I am not sure how to do this:
This line of code extends way out to the right. Can I chop it up, such as:
For some reason, I don't think that my chopping this up is a good thing.
Code: Select all
$sql = "SELECT client_no, access_level, logo_file, main_page, last_login, audit_year, active_client, email_address FROM $table_name WHERE login_id='$myusername' and login_password=aes_encrypt('$mypassword', 'bubbagump')";
Code: Select all
$sql = "SELECT client_no, access_level, logo_file, main_page, last_login, audit_year, active_client, " .
"email_address FROM $table_name WHERE login_id='$myusername' and " .
"login_password=aes_encrypt('$mypassword', 'bubbagump')";