web_master Posted October 8, 2007 Share Posted October 8, 2007 Hi, I think this will be a question of experince. Of a time when I begin to write the PHP scripts I do a changes in a style of a writing. Mean at the begin I uses a spaces us a distancer but for now I use the tabs. (not everywhere). <?php // Reload == 2 if($_REQUEST['reload']<SPACE>==<SPACE>"2") { // Insert into dBase $query_return=mysql_query("INSERT INTO `vendegkonyv`<SPACE>( <TAB> `vendegkonyv_nev`, `vendegkonyv_varos`, `vendegkonyv_orszag`, `vendegkonyv_txt`, `vendegkonyv_datum` ?> Can somebody tell me is some difference in this two writing styles? --------------------------- The other thing is maybe a same differences. This is a simple example: <?php $query_return = mysql_query("SELECT * FROM `vendegkonyv` WHERE `vendegkonyv_id` = ' " . $_POST['value'] . " ' "); ?> Up is at end of line: apostrof, quote, dot, POST, dot, quote, apostrof <?php $query_return = mysql_query("SELECT * FROM `vendegkonyv` WHERE `vendegkonyv_id` = '$_POST['value']'"); ?> Up here is at end of line: apostrof, POST, apostrof. Is some difference or maybe is there some other way of use? thanx T Link to comment https://forums.phpfreaks.com/topic/72307-solved-what-is-better-space-or-tab/ Share on other sites More sharing options...
Norsk.Firefox Posted October 8, 2007 Share Posted October 8, 2007 The last question: It's the same thing, but it's better to do the last code cause it's more readable where the variable is colored different. (And you have to validate input to mysql ) I didn't understand the first one. But <?php mysql_query("INSERT INTO `table` VALUES('value1', 'value2')"); ?> and <?php mysql_query("INSERT INTO `table` VALUES('value1', 'value2')"); ?> is the same thing. Link to comment https://forums.phpfreaks.com/topic/72307-solved-what-is-better-space-or-tab/#findComment-364574 Share on other sites More sharing options...
web_master Posted October 8, 2007 Author Share Posted October 8, 2007 At first is a difference between SPACE and TAB at begin of line. What U use when write script on line beginings: space or tabs? Link to comment https://forums.phpfreaks.com/topic/72307-solved-what-is-better-space-or-tab/#findComment-364578 Share on other sites More sharing options...
Norsk.Firefox Posted October 8, 2007 Share Posted October 8, 2007 I regularly use tabs, but I do also use spaces when aligning the text sometimes. I would normally use tabs and spaces in the example i used above: <?php mysql_query("INSERT INTO `table` VALUES('value1', // Double tabs and three spaces 'value2')"); // Double tabs and three spaces ?> But the spaces, breaks and tabs work great around each other Edit: Just make it most readable by using the possible highlights. Link to comment https://forums.phpfreaks.com/topic/72307-solved-what-is-better-space-or-tab/#findComment-364581 Share on other sites More sharing options...
web_master Posted October 8, 2007 Author Share Posted October 8, 2007 That mean there is a no difference between a dot and tab... hm... Link to comment https://forums.phpfreaks.com/topic/72307-solved-what-is-better-space-or-tab/#findComment-364582 Share on other sites More sharing options...
Norsk.Firefox Posted October 8, 2007 Share Posted October 8, 2007 It is difference between a dot "." and a tab " ".. But not spaces " ", tabs " " and breaks " ". (It is a difference in some cases, but mostly when you are writing text to the page, the visualization may be different.) Link to comment https://forums.phpfreaks.com/topic/72307-solved-what-is-better-space-or-tab/#findComment-364590 Share on other sites More sharing options...
web_master Posted October 8, 2007 Author Share Posted October 8, 2007 Thanx! Link to comment https://forums.phpfreaks.com/topic/72307-solved-what-is-better-space-or-tab/#findComment-364597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.