database Queries with PHP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dannysheps@hotmail.com
    Second Lieutenant

    • Feb 2008
    • 138

    database Queries with PHP

    Hello
    im trying to make something like in this site : www.craigslist.com

    after the information was queierd and put into a table on my page (with php) you have the Title as a link that i want the link to open a new page that there you can see (or even add more information) about what the user posted .

    is there a way to make the page/computer/php code to remember on what the user pressed and take all the information and "print" it on the screen in another page

    wow i hope i didnt mess it up too much

    thanks
  • Vasili
    Moderator

    • Mar 2006
    • 14683

    #2
    Re: database Queries with PHP

    You have set a budget for this, correct?

    This involves custom programming/coding, and if you are looking to do this on the cheap you are quite mis-guided......to get what you want, ABVFP can only do so much, and what you are modelling after is a different animal altogether!

    You may inquire with General Navaldesign, and also explore the possibilities by creating a free account at and posting a job to www.odesk.com to see what kinds of bids come in.......you will definitely need to be clearer and detailed to fully describe the parameters of your project, no matter who agrees to undertake it on your behalf!
    . VodaWebs....Luxury Group
    * Success Is Potential Realized *

    Comment

    • navaldesign
      General & Forum Moderator

      • Oct 2005
      • 12080

      #3
      Re: database Queries with PHP

      Well, it is rather simple. You can include in the link (at the end) a ?id=999&name=George&town=Texas etc. This is using the GET method to pass the variable names and values to the new page. In this new page you will capture your variables with the following:

      id = $_GET['id'];
      name = $_GET['name'];
      etc for all passed variables and values
      Navaldesign
      Logger Lite: Low Cost, Customizable, multifeatured Login script
      Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
      DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
      Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

      Comment

      • dannysheps@hotmail.com
        Second Lieutenant

        • Feb 2008
        • 138

        #4
        Re: database Queries with PHP

        thanks alot ill try that

        Comment

        • dannysheps@hotmail.com
          Second Lieutenant

          • Feb 2008
          • 138

          #5
          Re: database Queries with PHP

          hi
          naval,one more question i want to ask , when im adding this line :
          ?id=999&name=George&town=Texas
          can i write a code that will automaticaly store the var' from the database ?

          let me try to explain with an example :(database colum)
          date (submission_date).......... title(posting_title)
          2/08 ..................................."hello my name is"

          the title "hello my..." is a link that i want it to be opened in a new page that i can extract all the nessesary information.

          can i include in that link the php code that will store for each row of my table that var' i need to use after

          thanks

          Comment

          • navaldesign
            General & Forum Moderator

            • Oct 2005
            • 12080

            #6
            Re: database Queries with PHP

            Nor sure i follow you. Please rephrase.
            Also, the part " ?id=999&name=George&town=Texas " is NOT a line. it is an addition to the links that you create (the Title..) to go to the next page.
            Navaldesign
            Logger Lite: Low Cost, Customizable, multifeatured Login script
            Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
            DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
            Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

            Comment

            • dannysheps@hotmail.com
              Second Lieutenant

              • Feb 2008
              • 138

              #7
              Re: database Queries with PHP

              hi
              in this continuation ?id=999&name=George&town=Texas
              there are already fixed var'=999 =George... after the "="
              i wanted to know if i can add to the PHP code a command that will put in each row the correct variables for the link
              something like :

              link...?id=$_GET['id']&name=$_GET['name') etc.(still in the same page from the database)

              10x

              Comment

              • navaldesign
                General & Forum Moderator

                • Oct 2005
                • 12080

                #8
                Re: database Queries with PHP

                You can put variables, but not this way, because the $_GET global doesn't already exist, it will exist in the next page. You can do it like

                $link = "http://www.yourdomain.com/pagename.php?id=$row[id]&name=$row[name]&.... " etc. Then, use $link to link your Title to the next page. passing also the variables attached with the extension.

                where $row obviously is the array that contains the data from the database.
                Navaldesign
                Logger Lite: Low Cost, Customizable, multifeatured Login script
                Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                Comment

                • dannysheps@hotmail.com
                  Second Lieutenant

                  • Feb 2008
                  • 138

                  #9
                  Re: database Queries with PHP

                  hi
                  working ok...but one problem
                  on the address (explorer) bar it shows me the information also
                  like : www........../pagename.php?id=ron&address=1234 rebeca st.
                  and i have 1 colum that is the post itself can be 100 words even and it will show up also in the adress(link )
                  www...../pagename.php?posting=aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaid =999

                  and so on
                  can i do something that it wont show that ?

                  Comment

                  • navaldesign
                    General & Forum Moderator

                    • Oct 2005
                    • 12080

                    #10
                    Re: database Queries with PHP

                    Why shouldn't it display the info ? I mean, if in the next page you ARE going to display it, why not display it also in the address bar ?

                    Anyway, you can use another method: in the first page, where you retrieve the info from the database, store it in $_SESSION (you will need to start the session at the very begining of the page).
                    So you will have at the start of page

                    <?
                    session_start();
                    ....................
                    ....................

                    $_SESSION[id] = $row[]id;
                    $_SESSION[name] = $row[name];
                    etc.


                    In the next page,

                    <?
                    session_start;
                    $id = $_SESSION[id];
                    $name = $_SESSION[name];

                    etc.

                    Now you have your values stored in $id, $name etc. Or use directly the $_SESSION[....] if you don't wont to store them in local variables.

                    The link from the first to the second page now becomes a simple link. No ?id=...&... anymore

                    Anyway, please look in the net for some php / mysql tutorials, or buy some book that explains all the above, this forum cannot become a php teaching site, becuase this is not its scope. It is not a general interest argument.

                    Please also note that your logic is wrong, if you need to pass values to the next page you should only pass the record id nr, then in the next page, you should (again) retrieve the info directly from the database, quering the database ONLY for that id number.
                    Navaldesign
                    Logger Lite: Low Cost, Customizable, multifeatured Login script
                    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                    Comment

                    • dannysheps@hotmail.com
                      Second Lieutenant

                      • Feb 2008
                      • 138

                      #11
                      Re: database Queries with PHP

                      thats nicer way i suppose cus you wont have a link soooo LONG more decorative

                      and i want to thank you for your help !

                      Comment

                      • dannysheps@hotmail.com
                        Second Lieutenant

                        • Feb 2008
                        • 138

                        #12
                        Re: database Queries with PHP

                        what does it mean ?

                        Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/rgajsgjb/public_html/Donation/test.php:10) in /home/rgajsgjb/public_html/Donation/test.php on line

                        Comment

                        • navaldesign
                          General & Forum Moderator

                          • Oct 2005
                          • 12080

                          #13
                          Re: database Queries with PHP



                          You have pasted the session_start() code somewhere in the middle of the page instead of the very start as i suggested.
                          Navaldesign
                          Logger Lite: Low Cost, Customizable, multifeatured Login script
                          Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                          DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                          Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                          Comment

                          • kadm
                            Sergeant

                            • Mar 2008
                            • 23

                            #14
                            Re: database Queries with PHP

                            Need help with my php files that do not want to work on my site, the were working the day befor yesterday and have submitted a ticket, with no reply as yet. The problem is with contact and guest forms, can you help please.
                            site http://www.aaasuredealinternational.net

                            Comment

                            • navaldesign
                              General & Forum Moderator

                              • Oct 2005
                              • 12080

                              #15
                              Re: database Queries with PHP

                              Your contact form seems working, i can't know more details because the php file is not visible. Guest forms ? i tried the guestbook, if that is what you mean, and it works ok. If you meant another form, i didn't find it.
                              Navaldesign
                              Logger Lite: Low Cost, Customizable, multifeatured Login script
                              Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                              DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                              Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                              Comment

                              Working...
                              X