Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 28th, 2006, 12:23 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default sql query i need

Hello guys ,

I need sql query to get the first field values without specifying the name of that field, i also don't want to use fetch_array,fetch_row like mysql concepts over here.
Anybody please provide me ASAP

Reply With Quote
  #2 (permalink)  
Old July 28th, 2006, 12:25 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i need the result within today, atleast say it is possible or not.


Reply With Quote
  #3 (permalink)  
Old July 29th, 2006, 02:27 AM
Authorized User
 
Join Date: Mar 2006
Location: , , India.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Seearam,
Write in detail about your prbolem. So that it will be easy for all to have atlest a sketch.

We WILL...
Best regards
Milind

Reply With Quote
  #4 (permalink)  
Old July 29th, 2006, 08:57 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi guys,

I will give the explanation regarding sql query :

assume a table (user) having fields :
user_name,pass_word,ranking.
i need sql query to get the values of the user_name, without specifying user_name in the sql query.
like "select user_name from user"; this one i dont want , i need is there any query to get user_name values without specifying field name.

Reply With Quote
  #5 (permalink)  
Old August 28th, 2006, 11:06 PM
Authorized User
 
Join Date: Mar 2005
Location: , , India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to pritz Send a message via Yahoo to pritz
Default

Quote:
quote:Originally posted by seearam
 Hi guys,

I will give the explanation regarding sql query :

assume a table (user) having fields :
user_name,pass_word,ranking.
i need sql query to get the values of the user_name, without specifying user_name in the sql query.
like "select user_name from user"; this one i dont want , i need is there any query to get user_name values without specifying field name.

hi,

is it possible for you to user something like below
$sql="select * from user";
$res=mysql_query($sql)
$row=mysql_fetch_array($res);

and now u can fetch your values
echo $row[0]

hope it help if i got you correctly.
Regards

Reply With Quote
  #6 (permalink)  
Old July 6th, 2007, 05:37 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i dont want php to retrive first feild, i need to specify it in query

Reply With Quote
  #7 (permalink)  
Old November 20th, 2008, 03:11 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SELECT column_name
FROM information_schema.columns
WHERE table_name = 'tablename'

Reply With Quote
  #8 (permalink)  
Old November 30th, 2008, 03:14 AM
Authorized User
 
Join Date: Nov 2006
Location: mukalla, , Yemen.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

select top(1) from table_name
returns one row

Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sql query ldp101068 SQL Server 2000 7 December 18th, 2007 04:52 PM
Output Query to txt file from SQL Query everest SQL Server 2005 4 November 22nd, 2007 01:49 AM
SQL Query!! dpkbahuguna Beginning VB 6 5 October 12th, 2007 12:39 AM
Help with SQL query sattaluri Access 2 August 11th, 2006 09:26 AM
SQL query PinkyCat Classic ASP Databases 3 March 11th, 2005 01:41 PM



All times are GMT -4. The time now is 01:00 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.