1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

mysql table adminstration scripts in php

Discussion in 'PHP' started by gether, Jan 9, 2013.

  1. #1
    basically its a depressing fact that ... after learning a lot of shit .. you still cant program anything usefull .. even trying to come up with something to code ... is a hard task ..lol to kill some time i thought about staying with php and mysql programming ... beacuse you can try to think of something with programming langauge and its code.... after thinking my arse off ... i came up with the idea of a site .. where a video stream page can only be viewed by registered members ... for that .. you need.. . an index page / home page a registration page a login page .. a video streaming player .. JW player .. . capable of playing a video ... or something like that .. session protecting that page ... and i also thought about having an admin account where i can have some control over the table .... the only administration script i could of think of was an admin login page.. an admin script .. where the table of the users registered is echoed ... an admin script which can validate registered users .. where the admin can move the user information from a temporory table to a permenant user table ....
     
    gether, Jan 9, 2013 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    and your question is?
     
    EricBruggema, Jan 9, 2013 IP
  3. gether

    gether Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    the things i can do to a table as an admin ? or that particular previledged user who can run that special scritps ... to see .. edit .. modify .. the contents of that table ... i am intrested in ....
     
    gether, Jan 9, 2013 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    As an admin of a site? Whatever the script for that particular site allows you to do. There's no "generic admin privileges". Each site is different. Many sites don't even have the concept of an admin - just the creator, the webmaster (who may also be the creator) and the users.
     
    Rukbat, Jan 9, 2013 IP
  5. gether

    gether Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #5
    i was trying to learn to validate a registered user you know where a user fills the html form .. the php script takes the values and puts it in the users table ... waits for the administrator to see the table and validate the login ... somehow ... then the user logs in to the site ... usually the conenction between the form the script and the mysql table is as follows from what i have learned a variable name a variable value a place in the table for the variable name and variable value i was wondering which table variable name and variable value am i supposed to update as an admin ... i know that certain php functions are capable of generating peieces of codes... which can be assigned $variable_name so i think i am mostly trying to design a registration script ... which puts some sort of variable name and variable value in the table.. awaiting the administrator to update that variable value in that field.... am i thinking it right ?
     
    Last edited: Jan 10, 2013
    gether, Jan 10, 2013 IP
  6. gether

    gether Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #6
    what happened to all the spacing ? why isnt spacing working properly ?
     
    gether, Jan 10, 2013 IP
  7. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #7
    You're thinking as right as if you had never heard of motor vehicles and were describing how to win a car race. Learn computer programming first. You can't write a program without knowing programming, and that's only part of what you're trying to do. (The other alternatives are 1) muddle along and eventually, after a lot more work that it really requires, you'll end up with a pretty terrible site, 2) hire someone to write the site you want or 3) use a CMS or blog software.)
     
    Rukbat, Jan 10, 2013 IP
  8. gether

    gether Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #8
    you dont understand programming unless you work with examples.. that too having to deal with three programming languages.. html . php .. and mysql .... and its not like.. you sit behind the pc .. not wanting to learn anything .. [​IMG] i was thinking about storing a a variable value.. other than in a tables container .... where the registration form tries to svae that variable value ... and the administrator saves that variable value in the tables container ......................................................................................................................................................................................... basically i am trying to facilitiate login .. first the registration comes to the temporary db table but the login scripts checks the permenant db table and i as an administrator tries to move the passkey or any other related things to the permenant db ... ( as an act of validation ) so that the login script can work ....
     
    Last edited: Jan 11, 2013
    gether, Jan 10, 2013 IP
  9. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #9
    When is the last time you taught programming? You're so far off that you're not even wrong. Working with examples comes after you've learned some algorithms and some data structures. You don't learn reading by starting with reading words, you start by learning letters. No reading at all until you've learned at least a few letters.

    HTML isn't a programming language, it's a markup language. You learn programming - then PHP is trivial. Most programmers don't learn SQL until long after they can develop software. ("Web developers" - people who create garbage web sites, and couldn't program their way out of a wet tissue bag - "learn" everything at once. And their websites look and work like it.)

    No, it's like you read the course, wanting to learn something.

    From a programming viewpoint, that doesn't have any meaning. PLEASE learn programming before you tell us how you're going to program something.

    No need for it to be a temporary table.

    Or the login script just checks the user table (you only need one) to see if that user has been approved yet.

    A login script is about the most trivial programming you'll ever do on a website, and if you can't do that without getting it all wrong, you really should study before you try to write any code.
     
    Rukbat, Jan 11, 2013 IP
  10. gether

    gether Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #10
    basically its a depressing fact that ... after learning a lot of shit .. you still cant program anything usefull .. even trying to come up with something to code ... is a hard task ..lol to kill some time i thought about staying with php and mysql programming ... beacuse you can try to think of something with programming langauge and its code.... after thinking my arse off ... i came up with the idea of a site .. where a video stream page can only be viewed by registered members ... for that .. you need.. . an index page / home page a registration page a login page .. a video streaming player .. JW player ... capable of playing a video ... or something like that .. session protecting that page ... and i also thought about having an admin account where i can have some control over the table .... the only administration script i could of think of was an admin login page.. an admin script .. where the table of the users registered is echoed ... an admin script which can validate registered users .. where the admin can move the user information from a temporory table to a permenant user table ....
     
    gether, Jan 11, 2013 IP
  11. gether

    gether Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #11
    what happened to spacing all of a sudden ? why do i type in spaces .. and why does spacing dissapear when i post?
     
    gether, Jan 11, 2013 IP
  12. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #12
    Evidently you still haven't learned enough.

    BTW, I see spaces between your words. (One thing you may not have learned is that browsers eat multiple spaces - no matter how many spaces you put between words, it will appear as one space in your browser. You have to use CSS to move text over to show more space.)
     
    Rukbat, Jan 12, 2013 IP
  13. gether

    gether Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #13
    i tried to follow this tutorial here http://www.phpeasystep.com/phptu/24.html .. and modify it a bit for my own needs .... [​IMG] my idea still is .. to validate user registration .. make a script work as an admin .. so that user can login ... .......................................................................................................................................................................................... what the script in the tutorial does is ..... signup ...... emails page link ......... user clicks the link .......... the script in the page works ... now what does it do ? ...........temp_members_db ............. now see if the administrator can move .. the .... session_register config.php $passkey=$_GET['passkey']; $tbl_name1="temp_members_db"; .................................................................................................................................................................................... registered_members .... login script...
     
    gether, Jan 12, 2013 IP
  14. edduvs

    edduvs Well-Known Member

    Messages:
    394
    Likes Received:
    31
    Best Answers:
    3
    Trophy Points:
    160
    #14
    Well your main idea (if understood correctly) is to register the members but to not let them login until you confirm their registration from an admin panel, if I'm right. Besides the fact that your lack of will to learn PHP and actually listen to our advices.

    For that you don't need a separate table as temp_members_db and registered_members. You can just make the users table (members) with one more field, named `confirmed` for example ENUM('0','1') with default '0'; This way you dont need to deal with it and insert it at the register because it will be '0' by default.

    Then for your "admin panel" at the confirm users registration area just use this to parse your unconfirmed users:
    You must learn how to smart code.
     
    edduvs, Jan 13, 2013 IP
  15. gether

    gether Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #15
    that is sort of right ... but i dont understand your script part a single bit ... sorry i am nooby ... who is slowly gradually picking up the ideas of variable name.. variable value.. $_GET['variablename'] .. the initialisation of a variable name ....the database connection config file .. the table selection in the database .. stuff like that ..

    now i was thinking about working on an administration script where the script echoes the table information..

    and i get to run the comfirmation script on the users on that particular table which i like to validate and facilitate login ..

    basically what the administration confirmation script does is .. move .. user information from the temporary table to the permenant table ...

    i have to improvise that part ..

    the original confirmation script checks for the passkey and if passkey found.. moves the rest of the information from temporary table to the permenant table ...
     
    gether, Jan 13, 2013 IP
  16. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #16
    That's your main problem. You're trying to write a computer program (the difference between 'script' and 'program' is the same as the difference between 'apple' and 'fruit' - a script is a type of program) without knowing how to write computer programs. You have to learn programming first.

    Which is not what you should be doing. You should be learning computer programming. What you're doing is learning the different colors that nails can be, then trying to design a house. How are you going to design the plumbing if all you know is the color of nails?

    You don't want to just echo the table information.

    You don't use two tables, you use one table with a field that indicates whether the user is confirmed or not. (The example you're following is wrong.)

    Which is the wrong way to do this sort of thing.

    Learn to write programs before you try to learn how to code what you wrote. (You write a program in English, not in a programming language. And what you wrote - using a temporary table - is just plain wrong. So you don't worry about variables yet, you rewrite things to do them right.)
     
    Rukbat, Jan 13, 2013 IP
  17. gether

    gether Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #17
    well you have a big point .. everytime i try to sit and watch a program work. . i try to think as deep as i can ... even a little hello world program has so many things in it .. so is with little programs of c++ .. java .. etc

    lets take this "confirmation.php" php program or script for example...

    all i still know is that you keep things line by line.. and things starts working ...

    there must be many " data types " which the programs can identify as a portion of something ...


    again take the program "confirmation.php"

    i still dont understand the if .. what that "keyword" does .. or how it works.. but it makes me wonder how it works all time...

    maybe conditional branching is created by a not or an and function on the software or hardware ...
     
    gether, Jan 14, 2013 IP
  18. edduvs

    edduvs Well-Known Member

    Messages:
    394
    Likes Received:
    31
    Best Answers:
    3
    Trophy Points:
    160
    #18
    Lets take this for example: If I am hungry then I will eat, else, I will sleep. Now , lets get this into PHP.
    
    if ($mood == 'hungry') // supposing $mood contains the users mood, hungry or something else like sleepy, migraine whatsoever.
     // eat action
    else
     // sleep action
    
    PHP:
    If you don't understand the logics of programing I advice you start learning something else that fits you more. Computer programming or logics is not for everyone, that's the reason why we, programmers, get paid loads of money to do what we do on day to day basis.
     
    edduvs, Jan 15, 2013 IP
  19. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #19
    Learning programming will teach you how it works, wondering how it works won't.
     
    Rukbat, Jan 15, 2013 IP
  20. goliath

    goliath Active Member

    Messages:
    308
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #20
    What an odd thread. I agree you are starting in the wrong place.

    PHP is not a good place to start learning programming because it's a language made up of things people wanted from other languages.

    It SEEMS like a good place to start because it's considered an 'easy' language and it's very 'flexible'.

    But to someone who doesn't already have a firm grasp on the principles of programming and how computers handle and share data, it's a minefield of conflicting advice and confusing examples.

    gether it sounds like you're trying to learn something from a bad or outdated tutorial. Another byproduct of the sheer masses of people who have managed to "hack things out" in PHP, and then tell other people to do it that way because they're proud of achieving their goals.

    Nothing wrong with that either, except it causes a lot of confusion and angst.

    You won't get far here or in similar forums yet. Your comments are worded in such a way as to indicate you barely understand the principles enough to ask the question, and people will interpret them differently and return either derision, or more confusion to you.

    If you want to "jump in and get your hands dirty" with PHP as your very first programming language you should go about finding and downloading it for use on your local PC.

    Install a MySQL Server as well and you will be ready to learn. Getting these items installed and configured to work together will teach you about the environment you are going to work in, and guide you to ask constructive questions.

    Once you have learned a little bit about how these services interact, you will be ready to start working with the tools.
     
    goliath, Jan 15, 2013 IP