Jump to content

Zurev

Members
  • Posts

    260
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    New York!

Zurev's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. if ($line['hits'] < 10 || $line['hits'] > 1) Less than and greater than are your friends, the double pipe | means OR. http://php.net/manual/en/language.operators.logical.php
  2. You need a join, whether it be using the join keyword, or using the traditional method: update #__jrleech, jos_users u, jos_roxsuite_membership_history m set `published` = '1' where `id` = '".$row->id."' and u.id = m.id; That definitely won't work, since it's hard to understand your actual question, but that should give you some guidance as to pulling values from multiple tables.
  3. No one suggested the use of is_null? I mean empty works, but also if it's equal to 0. http://www.php.net/manual/en/function.is-null.php
  4. Assuming the users are returned in an array, array_merge would do exactly what you're looking for.
  5. Checking if an already existing row is in the database before inserting an identical one is child play? Pft.
  6. Why not check for a row with the same values, if it exists, don't insert the row. Otherwise, insert it.
  7. $query = "SELECT DISTINCT property_functionsexperience FROM #__users_profiles WHERE published = '1' ORDER BY property_functionsexperience ASC"; $functionsexperiencelistgeneral=doSelectSql($query); foreach($functionsexperiencelistgeneral as $words) $property_funcexperilist=$words->property_functionsexperience; $wording = explode(', ', $property_funcexperilist); $wording = array_unique($wording); foreach($wording as $funciex) $funcexpList .= "<option value=\"".$funcexi.','."\">".$funcexi."</option>"; $funcexpList .= "</optgroup>"; } $funcexpList.="</select>"; $output['FUNCEXPLIST']=$funcexpList; That should work, you may want to think on making easier to read variable names, and ones that better describe what you're doing, otherwise later on it's going to be hard for you to remember what's going on.
  8. mysql_query creates a resource. You're updating where username equals resource id whatever. So: //record date of most recent login $result = mysql_query("SELECT username FROM users WHERE user_id ='".$_SESSION['userId'] . "'"); $theUsername = mysql_fetch_row($result); $theUsername = $theUsername[0]; $dtCreated = date('Y-m-d'); mysql_query("UPDATE users SET lastvisit=('$dtCreated') WHERE username = $theUsername"); Give that a try.
  9. First thing I would try is to do it with fopen instead of file_get_contents - just to SEE if it works, in which case you've narrowed it down to it being file_get_contents' problem. OT: Why do you seem so focused on file size of a cms? It really doesn't make a noticeable difference, look at the top CMS's, even things like WP are 8+ megs.
  10. PHP is interpreted line by line, I don't believe you can declare something below it and have it work. Also, you're setting your cookie to exist for 5 seconds, might want to check on PHP's setcookie. http://www.php.net/manual/en/function.setcookie.php
  11. The site doesn't look extremely complicated, but even so, without knowing the system it would be difficult/time consuming, and without knowing PHP on top of that, it would definitely take a while. Also it seems part of it is powered by SMF, which could complicate things, though if it's an SMF file you overwrote, you can try and replace it with the same file from that version of SMF.
  12. First question, why are you passing MYSQL_ASSOC as a second argument to mysql_query(). mysql_query() takes the query, and an optional second argument as the link identifier, which that is not. If you're looking to fetch it as an associative array, it's already doing that with mysql_fetch_array, though you could switch it to mysql_fetch_assoc. Though that most likely isn't the issue, I wonder if it's causing any problems.
  13. Syntax highlighting is your friend! Variables in PHP must start with a letter or an underscore! Fix that and see if you're still having troubles.
  14. Can't you do tar -zxvf ?
  15. Right, you can for variables..but not constants: $variable = 'Hello World'; echo "Guess what? {$variable}"; // Guess What? Hello World
×
×
  • 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.