Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-11-2004, 12:40 PM   #1 (permalink)
Apprentice
 
Join Date: Sep 2004
Location: Thimphu
Posts: 87
Default How to retrive data from mysql database dynamically


Folks ,

I tried Dreamweaver MX 2004 to do it automatically, that coroupted my whole site..

So , can u plz write me one code for me , all i wanted is i have already stored data in the database , now what i want is to show that data in the web page dynamically, like say dynamic table !

can u u show me how and if possible plz give me a full php coding for retriving data from databse..

thanks
__________________
Flip like a butterfly, sting like a bee
Butterfly is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 03-11-2004, 10:26 PM   #2 (permalink)
Alpha Geek
 
Join Date: Feb 2004
Location: New Delhi
Posts: 890
Default

maybe this site helps :

http://www.abdn.ac.uk/diss/webpack/f...ml#section19.5
ishaan is offline  
Old 03-11-2004, 10:57 PM   #3 (permalink)
Version 2.0
 
Deep's Avatar
 
Join Date: Jan 2004
Location: Mumbai
Posts: 977
Default

i had given you the code in your last post i suppose..

need to use the same code to fetch the records and display the stuff in while loop...

Deep
__________________
- Deep Ganatra -
www.whoisdeep.com
www.twitter.com/DeepXP/
Deep is offline  
Old 03-11-2004, 11:02 PM   #4 (permalink)
Apprentice
 
Join Date: Sep 2004
Location: Thimphu
Posts: 87
Default

Well,

If i were damn expert in it i would have not post it in the froum...well yeah Deep u did post it last time , but u dinbt post it all , somne parts are blank, and thats a difficult for me to add..

never mind

thanks a lot
__________________
Flip like a butterfly, sting like a bee
Butterfly is offline  
Old 04-11-2004, 01:06 AM   #5 (permalink)
Version 2.0
 
Deep's Avatar
 
Join Date: Jan 2004
Location: Mumbai
Posts: 977
Default

Code:
<?php
mysql_connect ($host,$user,$pass);
mysql_connect_db ($database);

$sql = "SELECT id,image_path,image_description FROM pic";
$result = mysql_query ($sql);

while ($row = mysql_fetch_row($result))
{

$id = $row[0];
$image_path = $row[1];
$image_description = $row[2];

$show_stuff .= "<img src=\"$image_path\">
$image_description";

// ^^^ this will store all the values of table inside $show_stuff ^^^
}

echo $show_stuff;
?>
all done...
this is just basic..you need to customize it and add into your code according to your needs...

Regards
Deep
__________________
- Deep Ganatra -
www.whoisdeep.com
www.twitter.com/DeepXP/
Deep is offline  
Old 04-11-2004, 10:11 AM   #6 (permalink)
Right Off the Assembly Line
 
Join Date: Aug 2004
Location: Mangalore
Posts: 35
Default

is it work if v dont have sql server connection in our web site?
deeeeeeeep?
__________________
~Think Globally... Act Locally......!!!~
prakashaka is offline  
Old 04-11-2004, 10:13 AM   #7 (permalink)
Version 2.0
 
Deep's Avatar
 
Join Date: Jan 2004
Location: Mumbai
Posts: 977
Default

you need mysql server for that...

connection you have to make it using the code i specified about...

Deep
__________________
- Deep Ganatra -
www.whoisdeep.com
www.twitter.com/DeepXP/
Deep is offline  
Old 04-11-2004, 04:18 PM   #8 (permalink)
Apprentice
 
Join Date: Sep 2004
Location: Thimphu
Posts: 87
Default

Hellow Friends ,
This is the code am trying : have a look am getting error, if u all can fixed it up for me :

am getting error on this line : Parse error: parse error in c:\web\test.php on line 12

************************************************** *
<html><body>

<?
$host = "localhost";
$user = "root";
$pass = "";
$dbname = "karmas";
$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."
");
mysql_select_db($dbname)

$sql = "SELECT ID,logo,Description FROM client";
$result = mysql_query ($sql);



while ($row = mysql_fetch_row($result))
{

$ID = $row[0];
$logo = $row[1];
$Description = $row[2];

$show_stuff .= "<img src=\"$image_path\">
$image_description";

// ^^^ this will store all the values of table inside $show_stuff ^^^
}

echo $show_stuff;
?>
</body></html>

************************************************

My Table structure (karmas)

¦ID¦logo¦Description¦

************************************************** ***
Parse error: parse error in c:\web\test.php on line 12

($sql = "SELECT ID,logo,Description FROM client"; )

__________________
Flip like a butterfly, sting like a bee
Butterfly is offline  
Old 04-11-2004, 05:07 PM   #9 (permalink)
Version 2.0
 
Deep's Avatar
 
Join Date: Jan 2004
Location: Mumbai
Posts: 977
Default

mysql_select_db($dbname)

should be

mysql_select_db($dbname) ;

Deep
__________________
- Deep Ganatra -
www.whoisdeep.com
www.twitter.com/DeepXP/
Deep is offline  
Old 04-11-2004, 05:30 PM   #10 (permalink)
Apprentice
 
Join Date: Sep 2004
Location: Thimphu
Posts: 87
Default

Thanks Deep,

It finally worked , i like it ,...... something not yet arranged ..

cant the data be in dynamic table , so that what ever i retrive it from the datbase it directly show it in table in the browser ..

Let me know more

thnaks
__________________
Flip like a butterfly, sting like a bee
Butterfly is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 05:07 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2