Jump to content

albertdiones

Members
  • Posts

    4
  • Joined

  • Last visited

albertdiones's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. From what I understood from the post and the code: You want to query all author id from mugallery table, and for each author id repetitively query the joined mugallery and user table (I assume to get the first name and last name) then output the gallery thumbnail. I suggest having a simpler query, that is: <?php $query = mysql_query( " SElECT * FROM users INNER JOIN mugallery ON users.user_id = mugallery.author_id ORDER BY user_id" ); while ($row = mysql_fetch_array($query)){ echo $thisThumbToDisplay ; echo <<<EOT <div class="thumb"> <div class="title"> $row[title]</div> <div class="image"> <a href="display.php?imageid=$row[imageid]"> <img src="uploads/thumbs120/$row[filename]"/> </a> </div> </div> EOT; } (for some reason I can't make the capital l on this keyboard. lol)
  2. Make sure that register.php actually exists. better yet, just remove it <form method=post>
  3. If you got a currency table, with columns usd, eur, gbp: public function convert() { $price = $this->EE->TMPL->fetch_param('price'); if( $price === FALSE ) { return array(); } $query = $this->EE->db->select( "usd, eur, gbp" )->get( "currency" ); $currency_values = $query->num_rows() ? array_shift($query->result()) : false; // Only if there are results if (!$currency_values) { throw new Exception("No currency row found in the database"); } foreach ($currencies as $currency => $currency_values) { if (!$currency_values) { throw new Exception("$currency currency has blank value"); } } $return = array( 'usd' => $price * $currency_values['usd'], 'eur' => $price * $currency_values['eur'], 'gbp' => $price * $currency_values['gbp'] ); return $return; } I got no idea actually about "EE" but I made that based on the documentation hoping it'll help or give you idea at least. Btw. having a currency table with only one row doesn't seem to make sense to me, I could have understood it wrong though, but if I didn't, I suggest having a currency row with ( currency varchar, usd_value decimal ) table instead
  4. As far as I know you should filesize() the tmp_name not the name of the $_FIlE['file'] (with the capital l, dunno what's up with this keyboard) Edit: well, how to delete this? lol. I didn't saw it was already solved. sorry. Anyway, just a tip adi123, on that construct you should do if (is_int($size) && $size < 1048576) { // Script If the size is valid } else { // if the size isn't valid }
×
×
  • 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.