October 23rd, 2012, 01:26 PM
Php mysql noob question
i was following a tutorial on a site , and after reading it and trying to learn from it ... i have arranged a lot of things...from it ..
i am a noob in php and mysql and i still do not understand a lot of things ...
We are sorry, new user accounts are not permitted to create posts containing URLs
what a bucn of ****ing amazing idiots
what are those things marked in red called ?
October 23rd, 2012, 02:26 PM
Is it just me or maybe nobody will find out what are you talking about?
Originally Posted by phpnoob13
a) You cannot post links because you're new.
b) You just created this thread and the whole account for your trouble (user phpnoob :S)
c) Are trying to troll us? Or is it a legit real request? If so, you can put your links replacing . for , and write again the whole question EXPLAINING what's happening, what are you trying to do, what should happen (what would you LIKE and WANT to happen) as expected, and what actually happens and gives you an error message.
October 23rd, 2012, 03:32 PM
without posting the image .. i could not ask any questions ...lol
anyway my doubt was .. what is those things marked in red called ?
are those called connection variables ?
and why are some variables in brackets ?
October 23rd, 2012, 03:47 PM
Well, my friend.
The parts marked with $ just like $help are variables.
Many of them containing a QUERY (A statement that will create a certain quantity of data handlings and almost always will return a value).
The first chunk of code will do as follows:
Set $sql3 as a variable containing a query. (Select every match of 'id' -given in a prior part of the code not provided in your chunk - of that part only we care about the field named 'view', on a table provided by another variable also not provided in your example). See? It's easy.
Then we execute a query named $sql3
Guess what... yes, it's the one I described above, mate.
Then, we create an array (a long 'list' of things - you better get backup from a manual, I recommend Php And MySQL from Novice to Expert from Jason W. Gilmore, he's a crack) from the obtained results.
Variable 'view' ($view) contains the array, of values obtained from... guess... the row VIEW from the last query executed.
You may be able to find out the rest. Believe this are the basic facts, so you better handle it well before heading far away in the theme.
October 23rd, 2012, 03:52 PM
insulting us is truly a brilliant way to make us feel warm towards you and willing to answer your questions
Originally Posted by phpnoob13
the reason for the "no urls for new members" rule is simple -- spammers
blame them, not us
to answer your question, those things you marked in red are called php variables
some of them are in parentheses because the relevant php syntax (e.g. a function) requires it
feel any better now?
October 23rd, 2012, 04:13 PM
thanks for the book suggestions and thanks for clearing my doubts
October 24th, 2012, 08:24 AM
Before you get too far, find a different tutorial. The mysql functions in your example are depreciated and if you're just starting out, you should be learning mysqli or PDO. It will make your like so much easier to learn correctly the first time.
Comments on this post
October 24th, 2012, 10:39 PM
You're welcome. But learn to handle your messages in a proper way, learn from the older users here, I've spent little time but I have learned a lot from this people.
Keep on my reco and read that book. It covers both PHP and MySQL also with security tips.
Keep an eye on your language, and welcome.