Hi, I have this code: <?php include 'connect.inc.php'; include 'header.inc.php'; $mesiace = array("Január", "Február", "Marec", "AprÃl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"); echo '<div id="rozpis">'; $sql = "SELECT game_id, rival_id, result, h_a, UNIX_TIMESTAMP(datum) AS datum FROM game ORDER BY datum ASC"; $result = mysql_query($sql, $db) or die("ERROR: ".mysql_error()); if(mysql_num_rows($result) > 0) { echo '<table>'; echo '<tr><td>Dátum</td><td>Domáci</td><td>Hostia</td><td>Výsledok</td></tr>'; while($row = mysql_fetch_array($result)) { extract($row); $prikaz = 'SELECT rival_id, name FROM rival WHERE rival_id = '. $rival_id; $vystup = mysql_query($prikaz, $db) or die(mysql_error($db)); $rival = mysql_fetch_array($vystup); echo '<tr>'; echo '<td>' .date("j. F Y", $datum). '</td>'; if ($h_a == 1) { echo '<td> Capitals </td>'; echo '<td>' .$rival['name']. '</td>'; } else { echo '<td>' .$rival['name']. '</td>'; echo '<td> Capitals </td>'; } echo '<td><a href="zapas.php?zapas='. $game_id.'">' .$result. '</td>'; echo '</tr>'; } echo '</table>'; } else echo 'No matches'; echo '</div>'; include 'zahlavie.php'; ?> PHP: When I run this script it writes this warning: Warning: mysql_fetch_array() expects parameter 1 to be resource, string given in H:\xampp\htdocs\rozpis.php on line 16 I really dont't know where is problem... In the table I have three rows, but it writes only the first one and then this message. When I run $query in phpMyAdmin it runs corecctly or when I use: echo mysql_num_rows($result) it goes corecctly also. I will be grateful, if you find the problem...
I have not much time so just a suggestion: Check your $result and see if you get what you desire. Also, check this http://stackoverflow.com/questions/5473981/warning-mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given-i Code (markup): hope it helps
I checked $result in: if(mysql_num_rows($result)) and it goes corectly...it also writes first row of the table but more not...
Im not anywhere close to good programmer but, that could be problem related to your xampp installation ?
I don't think, that there is a problem in xampp installation. I have used this type of script lots of times before and it was OK, but I don't understand where is problem now. I tried almost everything to make it right, but still doesnt go.