php mysql error - cant get result (so it lists the results)

mysql_num_rows(): on line 273 Error Could not select database

Page 1 of 1

2 Replies - 1051 Views - Last Post: 24 October 2008 - 11:59 AM Rate Topic: -----

#1 cfsr  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 24-October 08

php mysql error - cant get result (so it lists the results)

Posted 24 October 2008 - 11:04 AM

<?php




$query = "SELECT id, personnr, CONCAT(etternavn, ', ', fornavn) as navn, DATE_FORMAT(dato, '%d.%m.%Y') as d, DATE_FORMAT(dato2, '%d.%m.%Y') as d2, type, referanse, status, user_name, IF((UNIX_TIMESTAMP(dato)+'".$ny_søknad."') > UNIX_TIMESTAMP(NOW()), '1', '0') AS ny, utbetalt FROM soknader LEFT JOIN user ON userid = behandler ";


?>



Mod Edit: Please use code tags when posting your code. Code tags are used like so => :code:

Thanks,
PsychoCoder :)

This post has been edited by cfsr: 24 October 2008 - 03:20 PM


Is This A Good Question/Topic? 0
  • +

Replies To: php mysql error - cant get result (so it lists the results)

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: php mysql error - cant get result (so it lists the results)

Posted 24 October 2008 - 11:07 AM

Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:

  • Post the code you're having problems with (DONE)
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field

Was This Post Helpful? 0
  • +
  • -

#3 cfsr  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 24-October 08

Re: php mysql error - cant get result (so it lists the results)

Posted 24 October 2008 - 11:59 AM

error message;

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ./.../...../index.php on line 273
Error Could not select database

on posted script line 201 $num_rows = mysql_num_rows($result)or die("Error Could not select database");


Problem solved!!!!!!!

Error on
$query = "SELECT id, personnr, .......

Had entered a wrong word on the line!

This post has been edited by cfsr: 24 October 2008 - 03:16 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1