| | |
Mysql select tip
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2008
Posts: 136
Reputation:
Solved Threads: 0
Hai,
I had a mysql database and it contain columns like "id" and "name".
I am using the following query for selecting a name with an id .
My code is
It works and my problem is please let me know whether it is the easy way ? Or there is any other way to do this ?
Thanks in advance
Rajeesh
I had a mysql database and it contain columns like "id" and "name".
I am using the following query for selecting a name with an id .
My code is
$row=mysql_select("SELECT * FROM table where id='1'") or die(mysql_error());
$result=mysql_fetch_array($ROW);
$name=$result['name'];It works and my problem is please let me know whether it is the easy way ? Or there is any other way to do this ?
Thanks in advance
Rajeesh
•
•
Join Date: Dec 2007
Posts: 190
Reputation:
Solved Threads: 25
0
#2 Oct 11th, 2009
This is the way to do. If you need only name from the db, then simply use name in the SELECT statement instead of *.
php Syntax (Toggle Plain Text)
$row=mysql_select("SELECT name FROM table where id='1'") or die(mysql_error());
![]() |
Similar Threads
- MySQL SELECT rows In a Date Range (MySQL)
- MySQL multitable select problem. (MySQL)
- Mysql select query takes more time (MySQL)
- Displaying a limited number of words from MySQL (PHP)
- how to view the data accessed using mysql select statement (Visual Basic 4 / 5 / 6)
- MySQL SELECT question (PHP)
- bringing data from mysql using select box (PHP)
- MySQL Maestro (Computer Science)
Other Threads in the MySQL Forum
- Previous Thread: mysql query
- Next Thread: MySql Service doesn't run
| Thread Tools | Search this Thread |
amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm data database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier journalism keyword keywords kickfire laptop law legal license licensing linux managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb single sourcecode spotify sql sugarcrm syntax table techsupport thunderbird transparency virtualization





