note 108487 added to function.mysql-num-rows
| From: | valerie dot danielsen at globalcrossing dot com | Date: | Mon, 30 Apr 2012 19:55:12 +0000 |
| Subject: | note 108487 added to function.mysql-num-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187410@lists.php.net to get a copy of this message | ||
I'm new with PHP MYSQL. I've created a page that that links to an inventory database. What
I'm trying to do is sort tables by site name. I can achieve this manually but being we are
relocating devices from different sites from around the world We can easily update the inventory
however the site is hard coded in to to the web page. I need to query the site and seperate the
results by site without hard coding.
example I have 5 device in Eng1 and 10 in BKH7. All 5 devices will be moved to BKH7 which means I no
longer need to display Eng1 on my main page.
Right now I have seperate queries
$result1("SELECT * FROM devices WHERE site='Eng1'") ;
$result2("SELECT * FROM devices WHERE site='BKH7'");
ect...
Then I use the fetch array to return the values
<table>
while($row=mysql_fetch_array($result1)){
<tr>
<td>...</td>
</tr>
}
</table>
<table>
while($row=mysql_fetch_array($result2)){
<tr>
<td>....</td>
</tr>
}
</table>
Is there a way to do a foreach row return value that equals "site" so this way a table can
be created each time the site name changes?
Thank you for any help given!
</table>
----
Server IP: 69.147.83.197
Probable Submitter: 64.209.106.162
----
Manual Page -- http://www.php.net/manual/en/function.mysql-num-rows.php
Edit -- https://master.php.net/note/edit/108487
Del: integrated -- https://master.php.net/note/delete/108487/integrated
Del: useless -- https://master.php.net/note/delete/108487/useless
Del: bad code -- https://master.php.net/note/delete/108487/bad+code
Del: spam -- https://master.php.net/note/delete/108487/spam
Del: non-english -- https://master.php.net/note/delete/108487/non-english
Del: in docs -- https://master.php.net/note/delete/108487/in+docs
Del: other reasons-- https://master.php.net/note/delete/108487
Reject -- https://master.php.net/note/reject/108487
Search -- https://master.php.net/manage/user-notes.php