Hi the above was exactly what I was after then I ran into another problem. I wish to limit the initial query to only display 20 bands (eg rows 21-40 or 41-60). Since the query contains multiple rows for each band and this is not a consistent number for each band this can not be done in a...
Hi with a bit of my magic I come up with:
$bandids = array();
$query = mysql_query("SELECT * FROM bands LIMIT 0, 20");
while($band = mysql_fetch_array($query)) {
$bandids[] = $band['id'];
}
$bandids = implode(', ', $bandids);
$count = array();
$query = mysql_query("SELECT bid, filetype...
Hi the second query idea sounds good but if you do the second query using the 20 retrieved id's then surely the only way to do this is by putting it inside the loop which goes through the rows of the band query therefore adding an extra 20 querys.
Hi cheers worked a treat. Now I've run into a problem with the initial sql query. When I use limit to display the first 20 bands it displays the first 20 rows.
The trouble is that there is an inconsistent number of rows for each bands (depending on the filetype of the records in the tabs...
Hi, I need to display the number of guitar tabs, drum tabs, bass tabs, lyrics for each band. I understand that query below gets the information but I don't know how to display it for each band. Here's the code so you can see what I'm on about:
$query = mysql_query("
SELECT
b.id...
Hi no sorry didn't explain that too great. I meant I need it to display the number of guitar tabs, drum tabs, bass tabs, lyrics for each band. I understand that query gets the information but I don't know how to display it for each band.
Hi for example I did the following:
$query = mysql_query("
SELECT
b.id
, t.filetype
, count(t.id) AS thecount
FROM
bands b
tabs t
WHERE
b.id=t.bid
GROUP BY
b.id
, t.filetype
LIMIT 0, 20
");
while($band = $db->fetch_array($query)) {
echo "band id: $band[id] | count...
Hi, Basically I have a loop which does the following:
$query = mysql_query("SELECT * FROM bands");
while($band = mysql_fetch_array($query)) {
$tabs = tablinks($band['id']);
echo $tabs;
}
As it goes through the loop the tablinks function is done which contains 5 additional queries...
Ah k looks like the long way. I just got rid of the primary key field because I thought I didn't need it then I realized how would I deal with deleting them, if a user has more than one of the same item. Damn me.
Cheers for your help.
Hi, I know this sounds easy from the topic but what I'm wondering is how to delete just one record even if the criteria matches more than once.
For example say you have the table member_items:
uid | iid
1 | 2
1 | 2
Where uid is the members uid and iid is the items id. I want to be able...
Hi I wish to access my files at http://www.domain.ext/forum/threads/165 instead of http://www.domain.ext/forum/viewthread.php?tid=165
So I created a .htaccess file (and put it in the forum directory) with the following content:
RewriteEngine on
RewriteRule ^forums/([0-9]+)/([0-9]+)...
Hi worked a treat one prob though it goes onto a new line and the text after that aswell. I've uploaded the file so you can see http://www.flixon.com/shop/forum/test.htm
I strictly don't want todo this and be greatful if you could show me how to resolve it. Thanks
Hi, I've got a problem I expect you guys'll solve in 5 seconds but has been troubling all day.
Right here it is. I've got the following code:
<script language="JavaScript">
function updateCurrency() {
var totamount = document.newItem.payment.value
writeLayer("totalAmount", totamount);
}...
Hi I have the following script which should generate 3 unique random numbers and store them in the corresponding text boxes when run but it returns an error.
<script>
function addLuckyDip(lineNumber) {
var randomnumber[0] = Math.floor(Math.random() * maxValue) + 1;
var randomnumber[1] =...
If anyone's interested this is how I'm going todo it. Using the getdate function you recommended I will store the current:
$set['dom'] - day of month
$set['month'] - month
$set['year'] - year
in the settings each time I draw is made. I also have the following in the settings:
$set['hour'] -...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.