emsie Posted December 15, 2004 Share Posted December 15, 2004 Hi, I'm very new to dreamweaver and MySQL, and although I have set up my database, and have it all connected down the side of Dreamweaver, I do not know how to put it in to a webpage (and can't find anywhere which tells me how to, only how to set up connections, which I've done). Please can you give me a little step-by-step guide, or point me in the right direction of one. I really need to know how to search fields and display them on the page. Cheers in advance, Emma Quote Link to comment https://forums.phpfreaks.com/topic/2094-mysql-onto-a-web-page/ Share on other sites More sharing options...
obsidian Posted December 15, 2004 Share Posted December 15, 2004 think of it this way (i hope i'm not simplifying too much, but based on your question, i'm assuming no prior knowledge): 1. what do i want to pull from my database? (SQL query) 2. where do i want to store the results until i display them? ($result variable) 3. how do i look through my results and display them? (while loop) let's pretend that you simply have a small table called 'Names' with the following info: ID | Name ----------------- 1 | George 2 | Ralph 3 | Sandra First, what do i want to pull -- in this case, i just want to list all the names: $sql = "SELECT Name FROM Names"; Next, i store the results so i can loop through them: $results = mysql_query($sql, $conn); Once i have the data, let's loop through and print each individual record: while ($result = mysql_fetch_array($results)) { $name = $result['Name']; echo $name . "<br />"; } this will list through all the names you have pulled from the database. hope this helps get you started! Quote Link to comment https://forums.phpfreaks.com/topic/2094-mysql-onto-a-web-page/#findComment-6833 Share on other sites More sharing options...
emsie Posted December 16, 2004 Author Share Posted December 16, 2004 Thank you! No prior knowledge. That has helped a lot. Going to go and fiddle with some things. Thanks again. Emma Quote Link to comment https://forums.phpfreaks.com/topic/2094-mysql-onto-a-web-page/#findComment-6853 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.