Jump to content

riwas

New Members
  • Posts

    7
  • Joined

  • Last visited

riwas's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. the collation is set to: latin1_swedish_ci
  2. There is one question do I still need some help with...the data that I want to show used swedish Ä.Ö.Å signs... and I know that in MySQL i need to change it to the UTF-8 right, for me to be alble to see the right letters?
  3. Yes I did add if ($records==false) echo mysql_error(); right after $records=mysql_query($sql); <?php //make connection mysql_connect('localhost', 'xxxxx','xxxxxxxx'); //select db mysql_select_db('kunder'); $sql="SELECT * FROM apartments"; $records=mysql_query($sql); if ($records==false) echo mysql_error(); ?> <html> <head> <title>Lediga Lägenheter</title> </head> <body> <table width="600" border="1" cellpadding="1" cellpadding="1"> <tr> <th>Objekt</th> <th>Yta</th> <th>ID</th> <th>Kommun</th> <tr> <?php while($apartments=mysql_fetch_assoc($records)){ echo "<tr>"; echo "<td>".$apartments['objekt']."</td>"; echo "<td>".$apartments['yta']."</td>"; echo "<td>".$apartments['id']."</td>"; echo "<td>".$apartments['kommun']."</td>"; echo "</tr>"; }//end while ?> </table> </body> </html> But this time I got this message: No database selected Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/vuyaezcu/public_html/page1.php on line 34
  4. Now this is guite exiting to learn like this well, let's see... First of all, I notised that I'm missing the "if ($records==false) echo mysql_error();" ? I'm sorry, but I still don't get it I usually work with patients and not on computers, but I do want to learn!!! Could you please give me some more hints? Thanks!!!
  5. Hello Barand, Thank you for you reply! I don't quite understand what you mean. Did you spot a fault in my code?
  6. Hello, I'm trying to display records from a MySQL Database with PHP. I'm kind of new when it comes to PHP. But I made a code for display the record.. now this is my first time doing this. but instead of it working I received the below warning message... Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/vuyaezcu/public_html/page1.php on line 34 And this is my PHP code that I just made: <?php //make connection mysql_connect('localhost', 'xxxxxxx','xxxxxxxxx'); //select db mysql_select_db('kunder'); $sql="SELECT * FROM APARTMENTS"; $records=mysql_query($sql); ?> <html> <head> <title>Lediga Lägenheter</title> </head> <body> <table width="600" border="1" cellpadding="1" cellpadding="1"> <tr> <th>Objekt</th> <th>Yta</th> <th>ID</th> <th>Kommun</th> <tr> <?php while($apartments=mysql_fetch_assoc($records)){ echo "<tr>"; echo "<td>".$apartments['objekt']."</td>"; echo "<td>".$apartments['yta']."</td>"; echo "<td>".$apartments['id']."</td>"; echo "<td>".$apartments['kommun']."</td>"; echo "</tr>"; }//end while ?> </table> </body> </html> Does anyone know why this is happening? I have been trying to find out for my self, but don't seem to find anything helpful.. Thank you Girls and Guys;)! /J
×
×
  • 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.