Jump to content

kurtos123

Members
  • Posts

    19
  • Joined

  • Last visited

Recent Profile Visitors

1,200 profile views

kurtos123's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It works now, thanks for all your help Barand, i really appreciate it, have a nice day !
  2. Tried inplementing your code Barand but i am sorry it did not give any result. I need to print on my webpage the total number of games with the name "Bratz" and "yasmine ski dressup" which are in my mysql database. (SpelNamen means GameNames, SpelNaam means GameName). <?php $sWhere = ""; $i = 0; foreach($aSpelNamen AS $sSpelNaam) { $sWhere .= "name LIKE '%" . $sSpelNaam . "%'"; if(++$i < count($aSpelNamen)) { $sWhere .= " OR "; } } $rQuery = mysql_query("SELECT COUNT(id) as total FROM " . $pre . $sqlgame . " WHERE (" . $sWhere . ")"); $iCount = mysql_num_rows($rQuery); ?> bratz games (<?php echo $iCount; ?>)
  3. figured this out and it works but is there a much shorter way? Figured this out and it works, but is there a much shorter way ? <?php $sWhere = ""; $i = 0; foreach($aSpelNamen AS $sSpelNaam) { $sWhere .= "name LIKE '%" . $sSpelNaam . "%'"; if(++$i < count($aSpelNamen)) { $sWhere .= " OR "; } } $rQuery = mysql_query("SELECT id FROM " . $pre . $sqlgame . " WHERE (" . $sWhere . ")"); $iCount = mysql_num_rows($rQuery); ?> bratz spellen (<?php echo $iCount; ?>)
  4. [ code ]<?php $iKolommen = 5; $iGamesPerPagina = 60; $aSpelNamen = array( "bratz", "yasmine ski dressup", ); ?> [ / code ] I use above code to determine all games with name bratz and yasmin ski dressup in my database and to print them on my webpage. How can i print the exact number of all the games with those names ? Can you give me the exact code because i am a newbie in php. I tried a code but it only gives the number 2 because it counts the names and not the amount. Many thanks for your help in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.