Results 1 to 30 of 30

Thread: MySql and php using tables
      
   

  1. #1
    SirChick is offline Sergeant
    Join Date
    Jun 2007
    Posts
    24

    Default MySql and php using tables

    Would i be able to create tables on Microsoft Access and all the needed fields and links to each table etc and then use the SQL Code that it creates which you can view then import that into my PHP and HTML or is that not physically possible?

    Just wondering cos like Access is very good GUI program better than coding..

  2. #2
    Join Date
    Oct 2005
    Location
    England, UK
    Posts
    4,207

    Default Re: MySql and php using tables

    Oooh, I'd be interested to find out the answer to your question. I will keep popping back ... hope you get an answer soon.

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  3. #3
    SirChick is offline Sergeant
    Join Date
    Jun 2007
    Posts
    24

    Default Re: MySql and php using tables

    I'd be shocked if no one has thought of it... cos it does seem logically possible but i dont wana work all day on it and find out you can't so im hoping some one else has figured it out :P

    If you can it be a dream come true and a time saving moment !

  4. #4
    Join Date
    Oct 2005
    Location
    England, UK
    Posts
    4,207

    Default Re: MySql and php using tables

    Quote Originally Posted by SirChick View Post
    I'd be shocked if no one has thought of it... cos it does seem logically possible but i dont wana work all day on it and find out you can't so im hoping some one else has figured it out :P

    If you can it be a dream come true and a time saving moment !
    I'd be delighted! I know how to use MSAccess. Lol The other stuff leaves me feeling clueless. Fingers crossed but you may have to be the one to test it. Lol

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  5. #5
    Karen Mac's Avatar
    Karen Mac is offline General
    Join Date
    Apr 2006
    Location
    X marks the spot
    Posts
    8,353

    Default Re: MySql and php using tables

    I would assume that you can as i do it via Excel all the time. As long as the mysql viewed the format as acceptable you should be able to import it. Not sure if you would have to set up the headers to import to or not first tho. Id have to login and look to see if you could create a database and then import the headers totally.

    Karen

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  6. #6
    SirChick is offline Sergeant
    Join Date
    Jun 2007
    Posts
    24

    Default Re: MySql and php using tables

    Does that mean your going to check or are you suggesting that is what i should do. Wasnt sure then :P

    I dont own my own server yet mind. So for me testing would be a bit pointless cos i could not get an answer.

  7. #7
    Karen Mac's Avatar
    Karen Mac is offline General
    Join Date
    Apr 2006
    Location
    X marks the spot
    Posts
    8,353

    Default Re: MySql and php using tables

    Well... im not off to look this moment! I was suggesting thats what you could do. Perhaps if you were voda host customer, I might make the xtra journey, but I dont have a reason to log in and look at mysql and find out. For now I would assume that you can at least import it to a table that you create and use the import to populate the table.

    Karen

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  8. #8
    horus is offline Sergeant
    Join Date
    Jan 2007
    Posts
    29

    Question Re: MySql and php using tables

    Hi, I want to make my table so that if I add a value into one column it will add the same value to another table.

    Ex. Table customers
    memberid

    Table customers2
    memberid

    If I add a value into memberid in the customers table it will also be added to customers2 memberid.

    How can I accomplish this?

  9. #9
    SirChick is offline Sergeant
    Join Date
    Jun 2007
    Posts
    24

    Default Re: MySql and php using tables

    Karen Mac - I would be a vodahost customer if i knew it was possible.. no point in buy a host if i dont know weather i can achieve it yet.

    And horus make your own thread youll get more responses aimed at you that way.

  10. #10
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: MySql and php using tables

    Yes it is possible. However it takes lot of php knowledge to do this. At current the only one I know that have that kind of knowledge is Naval, Watdaflip and Davidunalica. Both Naval and Watdaflip will take on the job for a nominal fee. David- you'd have to ask.

    I am currently learning php and have discoverd how to store info in a flat file and then create a php script that will read the info in the flat file and place it in a display table in any manner I wish. When complete- it will cut my website directory from 150 pages to about 5 or so. So I know it is possible.

    Perhaps contact either of the members above for more solid input.

    Andy
    PHP- is a blast!

  11. #11
    Karen Mac's Avatar
    Karen Mac is offline General
    Join Date
    Apr 2006
    Location
    X marks the spot
    Posts
    8,353

    Default Re: MySql and php using tables

    SirChick..

    As I said, as long as you export in a compatible mode, it should be possible to populate a mysql database with a feed. If i go from excel you should be able to go from access same way. You may have to import it to excel or make a pivot table and then export it, but it shouldnt be a problem to manipulate it. You will still have to create the database before populating it in mysql then go to php my admin and do the import.

    Karen

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



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

    Default Re: MySql and php using tables

    Quote Originally Posted by horus View Post
    Hi, I want to make my table so that if I add a value into one column it will add the same value to another table.

    Ex. Table customers
    memberid

    Table customers2
    memberid

    If I add a value into memberid in the customers table it will also be added to customers2 memberid.

    How can I accomplish this?
    This is not automatically done by MySQL itself. It is your script that needs to update both tables. How do you update the tables ? Meaning what kind of script you use ?
    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!


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

    Default Re: MySql and php using tables

    Quote Originally Posted by SirChick View Post
    Karen Mac - I would be a vodahost customer if i knew it was possible.. no point in buy a host if i dont know weather i can achieve it yet.

    And horus make your own thread youll get more responses aimed at you that way.
    It is possible: export from Access to Excel. Then export again as CSV, so you can import it into 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!


  14. #14
    bobs-pcmall is offline Staff Sergeant
    Join Date
    Dec 2006
    Location
    Newcomerstown,Ohio
    Posts
    40

    Wink Re: MySql and php using tables

    navaldesign:

    We use MS Office Access Professional 2003.
    We are able to export directly from Access into csv type text.
    By right clicking on the Table, Query, or Forms. Note " Item can not be open or in design view"
    Select Export ::
    When New Window Opens "Export Form 'Name of Datbase Opened By Access' "
    From the dropdown Save as type. Here we select as ' Text Files (*.txt;*.csv;*.tab;*.asc) '
    If Encode Window Pops Up "Encode As Unicode (UTF-8 then select OK.
    The Next Window Should Be Export Text Wizard;
    Select Delimited. Then Next. Here we prefer to use Semicolon, and Text Qualifier; We use the Broken Bar {Alt+0166}
    We use broken bar because some items in text fields contain qoutes.
    These seem to import fine into MySql Tables. We have used Include Field Names on First Row; but don't always get the results we
    wanted.
    It's Best to create database and tables first, then import.

    Hope this was helpful.
    Bob the Builder
    www.bobs-pcmall.com
    Without Data, you're just another opinion.

  15. #15
    SirChick is offline Sergeant
    Join Date
    Jun 2007
    Posts
    24

    Default Re: MySql and php using tables

    Quote Originally Posted by bobs-pcmall View Post
    navaldesign:

    We use MS Office Access Professional 2003.
    We are able to export directly from Access into csv type text.
    By right clicking on the Table, Query, or Forms. Note " Item can not be open or in design view"
    Select Export ::
    When New Window Opens "Export Form 'Name of Datbase Opened By Access' "
    From the dropdown Save as type. Here we select as ' Text Files (*.txt;*.csv;*.tab;*.asc) '
    If Encode Window Pops Up "Encode As Unicode (UTF-8 then select OK.
    The Next Window Should Be Export Text Wizard;
    Select Delimited. Then Next. Here we prefer to use Semicolon, and Text Qualifier; We use the Broken Bar {Alt+0166}
    We use broken bar because some items in text fields contain qoutes.
    These seem to import fine into MySql Tables. We have used Include Field Names on First Row; but don't always get the results we
    wanted.
    It's Best to create database and tables first, then import.

    Hope this was helpful.
    So create the database and tables in access first or create them on the server first?

  16. #16
    horus is offline Sergeant
    Join Date
    Jan 2007
    Posts
    29

    Question Re: MySql and php using tables

    Yes, what kind of script do I use to update the tables. I only want 1 column to be updated in both tables.

  17. #17
    bobs-pcmall is offline Staff Sergeant
    Join Date
    Dec 2006
    Location
    Newcomerstown,Ohio
    Posts
    40

    Default Re: MySql and php using tables

    Sorry about the delay on getting back to you.

    We've created the database and tables on Access first.
    And then done the data entry.
    Next we've created the same database and tables with the mysqladmin in cpanel
    The one thing you need to be aware of is tables in mysqladmin seem to convert to lower case.
    Example 'Wireless_Networking' gets converted to 'wireless_networking'.
    Field names don't seem to be affected this way.
    And mysqladmin adds it's own ID field for record keepping.
    Emport fields must match data types.

    Updateing one or two colunms is the problem we are experiancing with Visual.
    Parseing the xml into the database to update records.
    Right now we're not sure if it's something here to do with the schema or mapping setup.
    When we get that figured out we'll be sure to post it in this forum.
    We're new at the sql part of this too. Have been working with static page for 5 years up till now.

    Hope this helps everyone out. I'll keep you all posted. Cheers.
    Bob the Builder
    www.bobs-pcmall.com
    Without Data, you're just another opinion.

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

    Default Re: MySql and php using tables

    You cannot usethe "Import "feature of phpMyadmin to update only one column. However, you can upload the csv file onthe server, and then have a simple php script that will look into the uploaded file, and update the MySQL tables accordingly (obviously, you need to set at leat one fild as index key filed, so each value will go in the correct record. )
    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!


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

    Default Re: MySql and php using tables

    Quote Originally Posted by horus View Post
    Yes, what kind of script do I use to update the tables. I only want 1 column to be updated in both tables.
    As i said, it can be done, but it requires a script. If you don't already have one, you could build it or have it built for you.
    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!


  20. #20
    bobs-pcmall is offline Staff Sergeant
    Join Date
    Dec 2006
    Location
    Newcomerstown,Ohio
    Posts
    40

    Exclamation Re: MySql and php using tables

    Thanks navadesign for you email;

    Wish we understood all this by now. Should have taken a college course last fall & didn’t.
    After reading your email and looking the implementation guidelines documentation over again. We see where we went wrong.
    We were trying to set it up similar to an RSS feed.
    When they said upload to FTP account. We thought they meant Web Site Server FTP account.
    Reason for this was the VARCHAR2 which seems to be an Oracle extension for SQL. In Oracle 10g, a VARCHAR2 column may be up to 4000 bytes and it may be up to 32767 bytes.
    We don’t have Oracle here and I’m not spending that kind of money on it either. Not for 4 user licenses.

    We assume we needed to set up a DOM or Cron Job to parse the xml file into the database early in the morning, Say around 3 to 5 am EST.
    So I guess it’s back to the drawning boards here.
    Bob the Builder
    www.bobs-pcmall.com
    Without Data, you're just another opinion.

  21. #21
    horus is offline Sergeant
    Join Date
    Jan 2007
    Posts
    29

    Exclamation Re: MySql and php using tables

    I have a php script and I'm trying to insert a date into my database, but I keep getting an error stating that it's missing an argument. I think I'm supposed to format it for the DB , but I don't know how.

    here's some of the code:

    $today = date("YYYY-MM-DD");
    /**
    * Inserts the given
    * into the database. Returns true on success,
    * false otherwise.
    */
    function addNewUser($Name, $Phone, $Email, $State, $City, $Address, $Address2, $Referredby, $today){
    global $conn;
    $q = "INSERT INTO members VALUES ('$Name', '$Phone', '$Email' , '$State' , '$City' , '$Address' , '$Address2' , '$Referredby', '$today')";
    return mysql_query($q,$conn);
    }

  22. #22
    bobs-pcmall is offline Staff Sergeant
    Join Date
    Dec 2006
    Location
    Newcomerstown,Ohio
    Posts
    40

    Default Re: MySql and php using tables

    horus;
    I believe this will be what you want here looking at what code is available.
    $today = date("Y-m-d");
    Change to this Caps gives full year 2007, month caps gives Jun, Day caps gives Mon. Lower case gives 07,06,18
    Bob the Builder
    www.bobs-pcmall.com
    Without Data, you're just another opinion.

  23. #23
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: MySql and php using tables

    If you want a full list of the possible choices for formatting you date they are located here

    http://us.php.net/manual/en/function.date.php

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  24. #24
    horus is offline Sergeant
    Join Date
    Jan 2007
    Posts
    29

    Exclamation Re: MySql and php using tables

    OK thanks, but I still can't submit the date to the database.
    The datatype for that column is varchar. When I changed the datatype to Date and tried to submit the date, nothing happens. Is there any more formatting that I have to use in order to enter it into the database?

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

    Default Re: MySql and php using tables

    The field should be type "Date".

    The formatting should be

    $date = date("Y/m/d");

    However, this is only important if you want to be able to format the date in any other format in your retrieval (display) script. Otherwise, you can simply use the varchar type and save the date as string, or also use a timestamp
    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!


  26. #26
    horus is offline Sergeant
    Join Date
    Jan 2007
    Posts
    29

    Question Re: MySql and php using tables

    Thanks, I realized that it was not inserting the date because I wasn't
    asking it to submit the date. LOL

    One question though, how can I make two columns relate to each other when they are in separate tables.

    Ex.

    Table 1
    Name|Email

    Table 2
    Name | Password

    How can I make it so that Name in both tables will be the same.

  27. #27
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: MySql and php using tables

    You would have to manually set them to be the same.

    Although if you are trying to have like a user login for one table, and user information in another, it would be best to relate an id between the two. That way if the name gets changed the two tables are still connected by the id, which shouldn't ever need to be changed

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

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

    Default Re: MySql and php using tables

    To write the same data in two tables you need a script that will run two queries. But, as Watdaflip stated, there should be a common data in both tables so that you can "join" the tables in your display script.
    A simple real life example: suppose you have three tables, One with Client details, one with Invoice numbers, and one with Invoice details. The first two are jointed through the Customer ID column, the second to the third through the Invoice number column.
    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!


  29. #29
    horus is offline Sergeant
    Join Date
    Jan 2007
    Posts
    29

    Question Re: MySql and php using tables

    That's what I want to know my tables have a common id but how do I join them? And if I join them will the 2 tables become one or will that column just link them?

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

    Default Re: MySql and php using tables

    They are simply linked (joined) and as such they can be treated as one by the scripts. But they always remain two independent tables.

    Please note that working with joined tables requires some coding experience, so can not pretend to create such scripts if you don't learn the correct syntax and use first. Google it, there are lots of tutorials on the net about MySQL tables.
    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!


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