Jump to content

annihilate

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by annihilate

  1. This line: if(mysql_num_rows($players >= 1)){ Needs changing to: if (mysql_num_rows($players) >= 1) {
  2. You need to use mysql_connect function if you're connecting to a MySQL database. http://php.net/manual/en/function.mysql-connect.php
  3. $az = range('a', 'z'); $current_letter = 'f'; $current_key = array_search($current_letter, $az); $next_letter = ($current_key !== false && $current_key < (count($az) - 1)) ? $az[++$current_key] : ''; echo $next_letter; // prints g Would obviously need some work to handle what happens if the current letter isn't found in the array or when the letter is z. Currently will just assign next letter to be an empty string in these circumstances.
  4. Take a look at subdate: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_subdate In your case, you could do the following and end the query with: WHERE rdate > SUBDATE(SYSDATE(), 1)
  5. If I understand the question correctly, you would need to change your order by to distance instead of pb. This is only going to work as you expect if all the distances are in the database in the same unit. eg 100 and 3000 mean 100 metres and 3000 metres. If you have entries like 100 metres and 3K, then its not going to work as expected.
  6. You have a comma in your insert statement after member5 which shouldn't be there. Remove the comma and try running the query again.
  7. Try this: <?php $cont = load_template("main-content"); $contid = $_GET['content_id'] == "" ? "about" : $_GET['content_id']; ?>
  8. Hi there, I have just switched over to php5 and so have started making the variables in my classes private and then greating a public function which gets them. Previously, I had this code in a page: echo $movies_base->cert_array[$movie['cert']]; cert_array is a var in the movies base class, and it is an array. Under php5, I have made cert_array private, and added a getter for it. So now I have echo $movies_base->get_cert_array()[$movie['cert']]; The above line is not valid code. My question is: is it possible to do what I need in one line or do I have to something like the following: $cert_array = $movies_base->get_cert_array(); echo $cert_array[$movie['cert']]; Thanks Colin
×
×
  • 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.