rashmi_k28 Posted March 4, 2008 Share Posted March 4, 2008 Hi, I am new to PHP. Why the variables is used in single and double quotes when used in mysql query. 2) Is there any procedure to design the GUI for the php pages. Please send me some of the links. How to design the php pages before implementation $sql="select * from tableA where status=".$status."'"; Quote Link to comment Share on other sites More sharing options...
Stooney Posted March 4, 2008 Share Posted March 4, 2008 The example you gave should actually be (more opinion based, but it's cleaner): $sql="SELECT * FROM tableA WHERE status='$status'"; As for single vs double quotes? PHP won't parse variables inside single quotes, but will inside double quotes. And when building sql queries, data from a variable should be enclosed in single quotes (as with $status in the example). Once parsed, query will look like this: (lets assume $status="suspended twice") SELECT * FROM tableA WHERE status='suspended twice' Without the single quotes, the query wouldn't work properly. Hope I was clear, I'm not the greatest with explanations. Quote Link to comment Share on other sites More sharing options...
blueman378 Posted March 4, 2008 Share Posted March 4, 2008 you need to make your questions a bit clearer, but im guessing your looking for some tutorials/ resources to get you started in php? btw for now i would leave the mysql stuff alone till you know some of the more basic stuff, refer to the above post tho as for the GUI the gui is still developed in html, you simply use php as a way to make it more dynamic by changing variables upon either user input or other criteria, one thing i will suggest is when starting out with php think of what you would like to be able to do/ achieve in the end and then narrow it down into small steps as practise really is the best tutorial (my opinion only some people will disagree), here are some good resouces that you should take a look at Tiztag - very basic PHP.net - Good Reference of everything W3schools - Good Reference of everything Matt Quote Link to comment Share on other sites More sharing options...
rashmi_k28 Posted March 4, 2008 Author Share Posted March 4, 2008 hi Thanks for the reply. It was very informative. I am not understanding how to design the page before implementing. Is there anu procedure to follow. For example:Where to place a banner or how to use the frames like that. What frameworks are normally used Quote Link to comment Share on other sites More sharing options...
haku Posted March 4, 2008 Share Posted March 4, 2008 PHP is a language that takes in a bunch of variables, and outputs text (for the most part). So if you want to design a site, you have to envision the (X)HTML you want to output, then program php to output that HTML. Some people will do a whole site design first then start working on the php, well others will do the php, and then use that output and design it using CSS. It depends on your personal preference. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.