Jump to content

sandstorm140

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by sandstorm140

  1. solved by moving theme directory to application->views
  2. Hello! I have the following code in my controller: $this->parser->parse('themes/default/index.php', $data); And getting error: However, when I type in the same url into the address bar, the page loads fine. I can't for the life of me figure out what's going on. Thanks in advance! ADDITIONAL INFO: Configs & Helpers are set as: //Commented lines I've tried. //$config['base_url'] = ''; //$config['base_url'] = 'http://localhost'; //$config['base_url'] = 'http://localhost/'; //$config['base_url'] = 'http://localhost/PB_MVC'; $config['base_url'] = 'http://localhost/PB_MVC/'; $autoload['helper'] = array('url'); My folder structure is: -PB_MVC --application --system --themes ---default
  3. Ahhhhh I believe I'm starting to understand now. Thank you for explaining it
  4. That just confuses me more. That's exactly how i would expect OR to work. -Check if first condition is true. If not, check if next condition is true. with AND -Check if first condition is true. If it is, check next condition for true. I don't understand in my case, why AND works opposed to OR. I only need one condition to be true. It's not possible to have a comment line on an empty line (since it's empty).
  5. yes i accidentally put a space in between the single quotes. && works thank you. and/or always confuses me. I think of 'and' as IF both/all values returning true, 'or' as IF either one of the values returning true.
  6. Greetings! I'm using the raintpl template engine. I'm parsing a file and trying ignore all empty lines and comment lines. The if statement in the index file should be pretty understandable. The issue i'm having is with the logical operator || OR. If I have both of them inside the if statement (as in the code below), it returns true. However if i remove either one of them, it works fine. How can I go about fixing this using the || OR method? index file: $explodeByReturn = explode("\n", $file); foreach($explodeByReturn as $l) { if(trim($l) != '' || substr(trim($l),0,2) != '//') { //if((trim($l) != '') || (substr(trim($l),0,2) != '//')) { //ALSO TRIED THIS WITH SAME RESULT $explodeByLine = explode('=', $l); $tpl->assign(rtrim($explodeByLine[0]), ltrim($explodeByLine[1])); } } lang_file PAGE_TITLE = Test page OK = OK SUBMIT = SUBMIT USERNAME = Username: PASSWORD = Password: MIN_CHARS_LOGIN = Minimum 6 Characters LOGIN_SUBMIT = Login //SOME COMMENT MORE_VARS = test var
  7. Hello, I'm using the following code. I'm wanting to display usernames from database: usernames table: users from field: online where online = 1. As you can see, i also have FROM accounts.accounts because later on I will need to pull information from that database simultaneously. Database: accounts table: accounts --Also has a field named "online". My problem is I should have 4 results equal to usernames.users.online=1. I get the correct 4 names, however, it seems to be looped over and over again hundreds of times. For example: username1 username2 username3 username4 //starts again.. username1 username2 username3 username4 ...etc SELECT usernames.users.name, usernames.users.online FROM usernames.users, accounts.accounts WHERE usernames.users.online = '1' I'm fairly new to MySQL, any help/advice would be splendid. Thanks in advance.
  8. Because I pull data from multiple tables and databases.
  9. I'd like to be able to sort an array by one of the 3 values (username, joindate, or last_login) before it gets echod off. using ksort($value[2]); or something that would work. How can I go about doing this? while ($row[67] = mysql_fetch_assoc($result[67])) { $rowRe[] = array(1=>$row[67]['username'], $row[67]['joindate'], $row[67]['last_login']); } foreach ($rowRe as $value) { echo(' <tr align="left" class="accountinfo"> <td align="center">' . $iii++ . '</td> <td>' . $value[1] . '</td> <td align="center">' . substr($value[2], 0, -9) . '</td> <td align="left" colspan="7">' . substr($value[3], 0, -9) . '</td> </tr>'); }
  10. Hey, my first post on phpfreaks.com I think what you're searching for is: $username = 'tedst'; $password = 'test'; $string = ($username == 'test' && $password == 'test'); if($string == true){ //test for variable string content not to see if $string has been set echo ('true'); } else { echo ('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.