This Is the Error :- Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/a4080554/public_html/application/models/applicationmodel.php on line 98 Here's The Code :- <?php /** * User Model * * * @copyright Copyright (c) 2008 [x-MoBiLe] Nulled * @license * @since 1/2/2008 */ ini_set('display_errors', 1); error_reporting(E_ALL); class Applicationmodel extends Model { //Constructor function Applicationmodel() { parent::Model(); } function getApplications($onlyBasic = false) { if ($onlyBasic == true) $appQuery = $this->db->query('SELECT * FROM applications WHERE user_id=0'); else $appQuery = $this->db->query('SELECT * FROM applications'); if ($appQuery->num_rows() > 0) { $applications = array(); foreach ($appQuery->result_array() as $appRow) { $applications[$appRow['application_id']] = $appRow; } return $applications; } else return false; } function getUserApplications() { $this->db->select('application_ids'); $this->db->where('user_id', $this->session->userdata('user_id')); $this->db->limit(1, 0); $userAppQuery = $this->db->get('users_applications'); if ($userAppQuery->num_rows() > 0) { $userAppRow = $userAppQuery->result_array(); $appQuery = $this->db->query('SELECT * FROM applications WHERE application_id IN (' . $userAppRow[0]['application_ids'] . ')'); if ($appQuery->num_rows() > 0) { $applications = array(); foreach ($appQuery->result_array() as $appRow) { $applications[$appRow['application_id']] = $appRow; } return $applications; } else return false; } else return false; } function isApplication($appName) { $this->db->where('application_name', $appName); $this->db->limit(1, 0); $appQuery = $this->db->get('applications'); if ($appQuery->num_rows() > 0) { $appRow = $appQuery->result_array(); return $appRow[0]['application_id']; } else return false; } function isUserCanAccessTheApplication($applicationId) { $this->db->select('application_ids'); $this->db->where('user_id', $this->session->userdata('user_id')); $this->db->limit(1, 0); $userAppQuery = $this->db->get('users_applications'); if ($userAppQuery->num_rows() > 0) { $userAppRow = $userAppQuery->result_array(); $userAppArray = explode(',', $userAppRow[0]['application_ids']); if (array_search($applicationId, $userAppArray) === false) return false; else return true; } else return false; } function getLanguages() { $this->db->select('lang_code, lang_name'); $this->db->from('languages'); $langQuery = $this->db->get(); $languages = array(); echo "</pre>"; print_r($appQuery); echo" </pre> if ($langQuery->num_rows() > 0) { foreach ($langQuery->result_array[] as $langRow) { $languages[] = $langRow; } } return $languages[]; } } ?> PHP: And line 98 Is $languages[] = $langRow; PHP: And This Is a Facebook Clone Script! Reply Plz
change foreach ($langQuery->result_array[] as $langRow) PHP: to foreach ($langQuery->result_array as $langRow) PHP:
I Removed The [] Things And Now This Error Is Cming! Parse error: syntax error, unexpected $end in /home/a4080554/public_html/application/models/applicationmodel.php on line 105 Code (markup): And The Line 105 Is Blank! Line 100 = } Line 101 = return $languages; Line 102 = } Line 103= } Line 104 = (Blank) Line 105 = ?> So Whats The Wrong The Line is Blank Man!
take the [] out of the return line too return $languages; PHP: $languages[] will put a new row in the array but you're asking it to return something that isn't created yet so its getting all confused. returning $languages will send the entire array back to the script that called it.
Yaa.Took It Out But Still The Error Is There. Now the Code Is function getLanguages() { $this->db->select('lang_code, lang_name'); $this->db->from('languages'); $langQuery = $this->db->get(); $languages = array(); echo "</pre>"; print_r($appQuery); echo" </pre> if ($langQuery->num_rows() > 0) { foreach ($langQuery->result_array as $langRow) { $languages = $langRow; } } return $languages; } } ?> PHP:
This lines $languages[] = $langRow; PHP: still needs the square brackets because we are adding $langRow to the array. Its the foreach and return lines that don't need the square brackets.
Man Now The Error Is Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/a4080554/public_html/application/models/applicationmodel.php on line 98 Code : { $this->db->select('lang_code, lang_name'); $this->db->from('languages'); $langQuery = $this->db->get(); $languages = array(); echo "</pre>"; print_r($appQuery); echo" </pre> if ($langQuery->num_rows() > 0) { foreach ($langQuery->result_array as $langRow) { $languages[] = $langRow; } } return $languages; } } PHP: Line 98 Is $languages[] = $langRow; PHP: Add me In Skype : k_a_i_f_ Facebook :
Ok, for starters, I'm not a "man" have you done a var_dump of $langQuery->result_array to check that it contains what you expect?
Sorry For saying Man ( I Need To Make this Error )! And i didnt make that script I dnt even know a bit of php Plz help
Well you might need to learn some before you go editing scripts like this. Atleast looking up some of the syntax would be a good start. Have you been back to where you obtained the script and asked for support? Aaaah, just spotted this line * @copyright Copyright (c) 2008 [x-MoBiLe] Nulled PHP: Not cool. I'm out. I don't help people rip off my fellow coders. If I charged you for my time you'd spend more than you would buying a legitimate copy.
Lets spell it out in language that your 12 year old brain can understand. I know what 12 year olds are like. I've got one of my own. If you take something that isn't yours it is called stealing. If someone takes something and "nulls" it and then gives it to you, it's still stolen and you still shouldn't have it. Even if you do it online it is still theft. And you lied when you signed up for that facebook account because you have to be 13 to get an account legitimately. Your online life has started with lies, deception and theft. Not a good start and it will taint you for years to come.
Really?but I searched For A Script It was About $100 ? Ohh! Yea I Am A Stealer And A Liyer ! How About If i use a Degugger ? Give me A link To it plz?