php,yiiRelated issues-Collection of common programming errors
SoLoGHoST
php internationalization gettext
I am trying to set up a way to allow members to translate strings into other languages. You can see an example here: TRANSLATIONS TESTSomeone recommended that I use php’s native gettext() function for this, instead of what I am already using to load the language files, which is this:function loadLanguageFile($language, $file) {$temp = array();$data = file_get_contents(‘./’.$language.’/’.$file.’.’.$language.’.php’);$codes = array (‘/(\’\s*\.\s*\$)(.+?)(\s*\.\s*\’)/’,’/(=\s*\$)(.+?)(\s*\.\s*\’)/
sourav78611
php android json android-listview
I am new in android , right now I am facing some issue with list view, one list screen is there with some name in list and when i click on any one of those name it should pass that id to another activity and where it has to fetch some data from database according to code but my activity is getting stopped… so please anyone help me out here… alluseractivity is connected to list which is showing some list, its working but employeedetails that activity is having some problem…. i have given x
oussama.elhadri
php android mysql json android-asynctask
i get this error when I try to connect Mysql DataBase using the code below. the objective is to add a new product to database.04-08 14:13:10.440: E/AndroidRuntime(1568): FATAL EXCEPTION: AsyncTask #204-08 14:13:10.440: E/AndroidRuntime(1568): Process: com.example.androidmanifest, PID: 156804-08 14:13:10.440: E/AndroidRuntime(1568): java.lang.RuntimeException: An error occured while executing doInBackground()04-08 14:13:10.440: E/AndroidRuntime(1568): at android.os.AsyncTask$3.done(AsyncTas
user3312672
php android json web-applications
I am making a andriod app which performs CRUD operations on a localhost php database here is my code and the log cat. please help to fix the errorsJSONParser.javapackage com.example.androidhive;import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.List;import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import o
Lightness Races in Orbit
php mysql string strlen
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <link rel=”stylesheet” href=”StylesTSL.css” type=”text/css” media=”screen”> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /> <title>Terraria Server List</title> </head> <body> <div id=”page”> <div id=”logobase”> <div class=”filler”>&l
Mark Nottingham
php android json
I am building an app that parsers json into a listview from a database. I have used a PHP script to encode the data from the database in the JSON format below:[{“id”:”1″,”artistname”:”Rihanna”},{“id”:”2″,”artistname”:”Katy Perry”},{“id”:”3″,”artistname”:”DJ Dibs”},{“id”:”4″,”artistname”:”Jamie Foxx”},{“id”:”5″,”artistname”:”Disclosure”}]Here is the parser class which returns the data above as a string:package com.example.jsontester;public class JsonParser {static InputStream is = null;static JSO
user3006788
php android mysql json error-handling
i am creating a simple android application that add user (register) and retrieve user(login)the first action work perfectly but the second force close and crush the application.can anyone help me???logCat04-02 08:24:18.532: E/JSON Parser(2380): Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject 04-02 08:24:18.536: W/dalvikvm(2380): threadid=12: thread exiting with uncaught exception (group=0xa4c06648) 04-02 08:24:18.568: E/AndroidR
dunc
php mysql wordpress
A short while ago, I asked a fairly lengthy question regarding a content filter for my website. The post can be found here, please feel free to have a read at your own leisure.I’ve accepted @DampeS8N ‘s answer because he answered well and sent me in the right direction.Unfortunately, the outcome of said question was that the content filter I’m using is simply too inefficient to run in the context of my application.Here’s the information:I have ~2000+ glossary terms* and ~1200+ species profiles**
Nick
java php android json
When I click login it just attemping to login and forced closed my appsThis is my logcat:12-13 00:19:08.809: E/JSON Parser(20761): Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject 12-13 00:19:08.809: W/dalvikvm(20761): threadid=9: thread exiting with uncaught exception (group=0x40018578) 12-13 00:19:08.829: E/AndroidRuntime(20761): FATAL EXCEPTION: AsyncTask #1 12-13 00:19:08.829: E/AndroidRuntime(20761): java.lang.RuntimeExceptio
Orochi1992
php android json exception httprequest
Hello I am working on a login activity but it always displays the following error:E/JSON Parser(12505): Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject 03-25 00:21:14.735: W/dalvikvm(12505): threadid=11: thread exiting with uncaught exception (group=0x41d83700) 03-25 00:21:14.775: E/AndroidRuntime(12505): FATAL EXCEPTION: AsyncTask #1 03-25 00:21:14.775: E/AndroidRuntime(12505): java.lang.RuntimeException: An error occured while
user1652319
php sql-server yii
Hi I have a problem where I am trying to get a total time that a job has taken (using database fields job_start and job_end time(7)) then adding this to another model’s field,the code i have is if (isset($_POST[‘Jobs’])) {$model->attributes = $_POST[‘Jobs’];$model->setScenario(‘closejob’);$model->status = 2; //set status to closed//date time difference – this is the part I need help with $diff = $model->job_start – $model->job_end;//need to get customer model and add time diff to
Alexander
php sql-server yii
I am using Yii with SQL SERVER When i inserting data it shows a errorCDbCommand failed to execute the SQL statement: SQLSTATE[42000]:[Microsoft][SQL Server Native Client 11.0][SQL Server]Conversionfailed when converting from a character string to uniqueidentifier..The SQL statement executed was: INSERT INTO [dbo].[tbl_acc_appTokens]([TockenKey], [UserProfileId], [ClientId], [Expired], [CreatedDate])VALUES (:yp0, :yp1, :yp2, :yp3, :yp4)In My controler $newApp = new AppTokens();$newApp->UserPro
Asad
php sql-server yii odbc sql-server-native-client
I found lots of answers about this question and it is asked in stackoverflow as well, but that answers do not solve my problem.The method they are telling in the forums and Q/A websites to connect PHP with MS SQL Server, I am using the same but I am getting the following error in YII FrameworkCDbConnection failed to open the DB connection: SQLSTATE[IMSSP]: Thisextension requires the Microsoft SQL Server 2012 Native Client ODBCDriver to communicate with SQL Server. Access the following URL todown
xles
php yii
I’m playing around with the Yii framework, and decided to do some file foo with the finfo class in php, like so:$finfo = new finfo(FILEINFO_MIME);This should work without issue (and it works just fine outside of Yii), I don’t see why it shouldn’t. However, this isn’t the case, Yii attempts to autoload the finfo class causing the obvious error:include(finfo.php): failed to open stream: No such file or directoryIs there a way to beat Yii into submission?Edit: I still haven’t figured out why it cr
tisha
yii yii-extensions yii-db cgridview
following is my code in view but i am unable to create button in cgridview <?php echo CHtml::link(‘Advanced Search’,’#’,array(‘class’=>’search-button’)); ?><div class=”search-form” style=”display:none”><?php $this->renderPartial(‘_search’,array( ‘model’=>$model,)); ?></div><!– search-form –><?php $this->widget(‘zii.widgets.grid.CGridView’, array( ‘id’=>’product-grid’, ‘dataProvider’=>$model->countregister($_GET[‘id’]), ‘enablePagination’ =&
teresko
php file-upload csv yii yii-cmodel
I am trying to upload CSV file using an Yii framework. I have added the code below : Model<?phpclass Import extends CModel{public $name,$email,$doctor = 0,$hospital = 0,$diagnostic = 0;public function rules(){return array(array(‘name,email,doctor,hospital,diagnostic’,’required’));}public function attributeNames(){return array(); }} ?>View(index.php)<div class=”form”><?php echo CHtml::beginForm(‘site/import’,$method=’post’,$htmlOptions =array(‘enctype’=>’multipart/form-data’));
Dency G B
php yii yii-extensions
I want to make a newsletter feature in my application. I need to send emails about 5000-6000 after I create a newsletter. When the newsletter is published it will create an email queue which will be stored in the database. Since it requires a lot of time I need to run it in the background. So I made a command to send the mail using YiiMailer and the email queue from the database.My command is working, but it is getting terminated after some time without completing the job. Also I need to run it
nosthertus
yii model checkboxlist
I have a problem on yii model, ive been told to use the generateAttributeLabel() on the model, but i tried to use it on the way i thought it would work but it doesnt. This is my codepublic function generateAttributeLabel($variable = file_get_contents(‘protected\column.txt’)) {return $variable; } public function attributeLabels() {return array(‘id’ => ‘ID’,’parametro_id’ => ‘Parametro’,); }There are some columns that are being generated automatically and i thought to save their names into
Sumit Gera
php yii
I am trying to write the code for parsing the uploaded .csv file. I have written the following code. The controller generates the rows of the CSV file in the form of arrays which I have also tried to print with print_r($buffer); statement and I get the expected output. Though the strings can be printed using echo $string;, but I am not able to pass them to the text-fields for editing before saving to the database.SiteControllerpublic function actionImport() {$buffer[] = array();if(isset($_POST[‘
armandomiani
php gridview yii
I’m trying to put these buttons inside my GridView:$extraButtons = array(‘class’=>’CButtonColumn’, updateButtonLabel => ‘Atualizar’,deleteButtonLabel => ‘Excluir’,viewButtonLabel => ‘Visualizar’,deleteConfirmation => ‘Deseja realmente excluir este ítem?’, buttons => array(‘btnCVs’ => array(‘label’=> ‘See resumes’,’url’=> ‘javascript:viewResumes($data->id_professional)’, //here is the line’imageUrl’ => ‘/gammarh/assets/dad4ddbc/gridview/cvs.gif’,’visible’ => ‘t
Web site is in building