How Do I Retrieve Data ? |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Zymic Free Web Hosting Databases & MySQL |
||
![]() |
How Do I Retrieve Data ? |
||
Oct 25 2011, 02:44 PM
Post
#1
|
|
|
Member ![]() ![]() Group: Members Posts: 45 Joined: 22-July 11 Member No.: 199,963 |
I've used md5 method to put the data in my table.
One of my friend told me to use it, as it is pretty secure. Now, I'm finding difficulty in retrieving the data. Now, How do I retrieve actual data not encrypted or random data? |
|
|
Mar 8 2012, 01:11 AM
Post
#2
|
|
|
Newbie ![]() Group: Members Posts: 6 Joined: 21-September 11 Member No.: 209,670 |
in web page php
CODE include("dataaccess.php"); $db_host = 'localhost'; $db_user = '658731_guest'; $db_pwd = 'enter'; $database = 'mydatabase_zxq_data'; $table = 'mytable'; mysql_connect($db_host, $db_user, $db_pwd) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $result = mysql_query("SELECT * FROM {$table} WHERE `recnum` = $recordnumber"); if (!$result) { die("Please Tell the web master you are seing this. contact him via the contact us page. Thankyou "); } $row = mysql_fetch_row($result); $one= $row[0]; $two= $row[1]; $three= $row[2]; $four= $row[3]; $five= $row[4]; $six= $row[5]; if($row[6] == "checked"){ $seven = "available.JPG"; $visable ="style17a"; }else{ $seven = "sold.JPG"; $visable ="style17b"; } mysql_free_result($result); I use this to get 1 record from the database into variables which i can then echo to the screen CODE <td><?php echo $row[0] ?></td> or CODE <td><?php echo $five ?></td> |
|
|
Mar 14 2012, 07:35 AM
Post
#3
|
|
|
Newbie ![]() Group: Members Posts: 4 Joined: 14-March 12 From: chennai Member No.: 234,201 |
It's better to separate database configuration details in separate php as config.php ,opendb.php and closedb.php and to include it on pages where required
|
|
|
![]() |
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 22nd May 2013 - 04:32 AM |