Select and then display mysql row and also tell php what its value is? -


how make select , display mysql row via php, , tell php value is? thanks.

here's code have attempted, don't know go there. huge php noob.

$notificationchk = "select * notification username='$_session['username']'"; 

okay. query crash couse ya! notice wrote this: 1 - "create variable. call variable notificationchk. also, make variable string"

2 - have nice variable, carries nice string. guess what? string message function, function accesses stuff database. database has tables, decent database does. table youre interested in called 'notification'

3 - name of database? well, assuming know because trying pull data table without pointing database kinda never going work unless very, lucky... guessing know database is, don't, i'm calling "stuff". "stuff" might have other tables other 'notification'. well, doesnt concern here, because need data 1 table: 'notification'. however, before can access table 'notification' in database stuff, need "point" stuff database. need use command, in "use stuff"...yes, before line wrote here ;)

4- hold on... need connection program stuff databases before try "use stuff" command... assume know that...

5 - well, see nice commands? use , select. there others insert , delete you'll need. important thing however, these not php commands. surprise!! consider them "mysql commands".

6 - confusing? well, php passes these commands mysql engine thingy, , why strings. nice line wrote "hey php, can please create string called 'notificationchk'?". what? need php command after send string mysql thingy. command "mysql_query", , nice function.

7 - after that, you'll this:

$resultofquery=mysql_query($notificationchk,$conn)

and friend, new variable (we called "$resultofquery") result of function mysql_query sending request '$notificationchk' using connection '$conn' must have created before took place. did use 'mysql_connect' command before this, right? in short (hehe) line wrote in little part of whole must learn. not hard @ all. if did it, can :d

8 - more... tell 2 things: hit tutorials/books, there no other way :) thing number 2 this: check error after every, mean every "query" command give. tutorials beginners might not stress this, it. you'll end lots of them , feel proud did.

live long , prosper _\//


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -