Jump to content

mikecampbell

Newly Registered
  • Posts

    88
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

mikecampbell's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It works for me. Are you echoing the random number immediately after you generate it?
  2. $firstname = "firstname_ord"; $lastname = "lastname_ord"; $fullname = $firstname . " " . $lastname; echo $fullname; Are you saying that this does not echo "firstname_ord lastname_ord"? If so, then what result are you expecting?
  3. It depends how many decimal places you want, but you could use mt_rand(0, 100)/10; to get numbers between 0 and 10 with one decimal place.
  4. Your SQL syntax looks alright. Are you sure you haven't typoed the table or field name? echo mysql_error(); will output a more descriptive error message.
  5. $query = "SELECT adder,min(title),count(*) as ct FROM shsh group by adder order by ct";
  6. You're missing '' around your array keys. $row[cust_no] should be $row['cust_no']
  7. Using the modulus operator like such might help you... <?php for($i=0;$i<=23;$i++) { $hour1 = ($i+6)%24; $hour2 = ($i+7)%24; ?> <tr> <td><?php echo $hour1;?>.00-<?php echo $hour2;?>.00</td> </tr> <?php } ?>
  8. No prob. Of course if all you are doing is validating a single email, performance will not be an issue and you could use the simplified version you suggested (which will be easier to generate programmatically).
  9. http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains As you can see, there are a lot of top level domains. If performance is a serious issue, you might be able to optimize the regex by using something like this /(c(om|a|y|etc)|e(du|u|etc)|etc)/ instead of /(com|ca|cy|cetc|edu|eu|eetc|etc)/ .
  10. The query string should be like ?name1=value1&name2=value2 etc. so try this: href="view-listings.php?live=1&id=<?php echo $showlistings['id']; ?>"
  11. imagecopyresampled() does not preserve transparency. Check this function (which unfortunately will be much slower than imagecopyresampled): http://www.exorithm.com/algorithm/view/scale_image
  12. As I read the requirements, he wants to match 1. numbers, or 2. numbers and letters ie, not just letters
  13. ctype_alnum() will return true if the input is all letters, which the poster does not want. Try this: return preg_match('/^[0-9a-z]*[0-9][0-9a-z]*$/i', $test);
  14. When PHP tests variables of different types with ==, it converts them to be compatible. If you compare (0 == false), it evaluates to true. Same if you compare ("" == false). However, (0===false) and (""===false) both evaluate to false.
×
×
  • 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.