Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old July 29th, 2003, 05:38 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #2  
Old July 29th, 2003, 11:15 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
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....

Reply With Quote
  #3  
Old July 30th, 2003, 08:53 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #4  
Old July 30th, 2003, 09:21 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
RE: Showing data vertical

try this:

$result = mysql_query("SELECT * FROM table WHERE username = '$uname'",$db);

Reply With Quote
  #5  
Old July 30th, 2003, 09:23 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
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

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Showing data vertical


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway