Jump to content

Wrapping lines of php code?


cgm225

Recommended Posts

If I have a long line of PHP code, like this::

 

        $statement = $connection->prepare("SELECT COUNT(*) FROM $table WHERE $usernameField = ? AND $passwordField = ?");

 

IS there a convention for inserting a return and wrapping the line of code?  Any indents in the second line?

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/103088-wrapping-lines-of-php-code/
Share on other sites

Ive seen way longer  :). If im getting this right, u want to have it in 2-3 lines, so simply:

 

<?php
$statement = $connection->prepare("SELECT COUNT(*) 
                                   FROM $table 
                                   WHERE $usernameField = ? 
                                   AND $passwordField = ?");
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.