+ Reply to Thread
Results 1 to 18 of 18

Thread: database Queries with PHP
      
   

  1. #1
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default 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

  2. #2
    Vasili's Avatar
    Vasili is offline Moderator
    Join Date
    Mar 2006
    Posts
    13,213

    Arrow 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!

  3. #3
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default 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!


  4. #4
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default Re: database Queries with PHP

    thanks alot ill try that

  5. #5
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default 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

  6. #6
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default 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!


  7. #7
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default 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

  8. #8
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default 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!


  9. #9
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default 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 ?

  10. #10
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default 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!


  11. #11
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default 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 !

  12. #12
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default 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

  13. #13
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default Re: database Queries with PHP

    http://www.tizag.com/phpT/phpsessions.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!


  14. #14
    kadm's Avatar
    kadm is offline Sergeant
    Join Date
    Mar 2008
    Location
    Vryheid South Africa
    Posts
    23

    Default 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

  15. #15
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default 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!


  16. #16
    kadm's Avatar
    kadm is offline Sergeant
    Join Date
    Mar 2008
    Location
    Vryheid South Africa
    Posts
    23

    Default Re: database Queries with PHP

    Sorry i got back so late all is working thanks navaldesign.

    Say can you help me with a sub domain http://www.aaasuredealinternational.net/vbnut/
    i have got it index, however i cannot google search it. eeven if i put the whole address in, google does not find it.

    Thanks in advance Kurt

  17. #17
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default Re: database Queries with PHP

    By full address, Goggle DOES find it (at least it did when i queried )

    Google doesn't index sites (and this is NOT a site, it is simple a folder in your main site) before some time (can be up to 3 and even more months)

    Then, to get indexed for keywords, is even harder, you need to do a good work with content, keywords, meta tags etc.
    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!


  18. #18
    kadm's Avatar
    kadm is offline Sergeant
    Join Date
    Mar 2008
    Location
    Vryheid South Africa
    Posts
    23

    Default Re: database Queries with PHP

    Thank you Navaldesign,
    I do appreciate it. Just could'nt understand it, as my main site http://www.aaasuredealinternational.net , i could google it fairly quickly. However i do understand a bit more.
    Thank you for all your help once again.
    I am going to work on the content, keywords etc this weekend.

    Keep well Kurt

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49