|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Showing data vertical
Hi
Every simple mysql "show data" tutorial is based on horizontal position so we have up-menu (name, nick, date...) and down-data showing. What I must do if I want something like that: ----------------------------- Menu |Data from mysql | --------|--------------------| Name |Name1 |Name2 | Surname |Surname1 |Surname2 | Address | | | Thank you for help slawko |
|
#2
|
|||
|
|||
|
RE: Showing data vertical
You will need to pull the data from your result set into an array. At that point you can display it however you choose....
|
|
#3
|
|||
|
|||
|
RE: Showing data vertical
OK, but why this below doesn't work?
$db = mysql_connect("db", "user", ""); mysql_select_db("",$db); $uname = $_SESSION['username']; $result = mysql_query("SELECT * FROM table WHERE username like "%$uname%" ",$db); $myrow = mysql_fetch_array($result); ?> <form method="post"action="<?php echo $PHP_SELF?>"> id:<input type="text"name="id"value="<?php echo $myrow["id"]?>"><br> email:<input type="Text"name="username"value="<?php echo $myrow["username"]?>"><br> website:<input type="Text" name="password" value="<?php echo $myrow["password"]?>"><br> <input type="Submit" name="update" value="Update"></form> I got the message: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource |
|
#4
|
||||
|
||||
|
RE: Showing data vertical
try this:
$result = mysql_query("SELECT * FROM table WHERE username = '$uname'",$db); |
|
#5
|
||||
|
||||
|
RE: Showing data vertical
one other thing, it's also bad coding to put your connection info in the code. Try a sub directory with .htaccess protection and use an include file connection.php
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Showing data vertical |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|