ssquare

Experience

650

0 Best Reply Awards

  • Member Since 1 Month Ago
  • 0 Lessons Completed
  • 0 Favorites

11th October, 2018

ssquare started a new conversation Catch Error If Arise On A Loop But Continue Ro Process Other Data From The Loop. • 4 days ago

Scenarion:

I am trying to dump data from csv file to MsSQL database. My code is as:

        /*here skip is just 0 or 1 if skip is 0 later that mapped row will be ignored. Map data contains index array which will later used to map csv column to database column*/

        $limit = $this->service->getSettingsNameValue('chunk_limit');
            $skip = $request->skip;
            $map_data = $request->row;

    /*Just reading csv file. Have used csv league*/
        $db_header_obj = new Sos_contribution();
            $db_header = $db_header_obj->getTableColumns();
            $csv_file_path = storage_path('app/files/sos_contribution/').$request->filename;
            $csv = Reader::createFromPath($csv_file_path, 'r');
            $csv->setOutputBOM(Reader::BOM_UTF8);
            $csv->addStreamFilter('convert.iconv.ISO-8859-15/UTF-8');
            $csv->setHeaderOffset(0); //set the CSV header offset
            $csv_header = $csv->getHeader();    

            $rec_arr = array();
            $records = array();
            $records_arr = array();

            $stmt = (new Statement())
            ->offset($offset)
            ->limit($limit)
            ;

            $records = $stmt->process($csv);

            foreach ($records as $record) 
            {
                $rec_arr[] = array_values($record);
            }

            $records_arr = $this->service->trimArray($rec_arr);

            if(count($records_arr)>0)
            {
                foreach($records_arr as $ck => $cv){

                    $sos_contribution_arr = array();
                    foreach ($map_data as $mk => $mv) {
                        if(!isset($skip[$mk])){

                                $data_type = $this->service->getDatabaseColumnType($this->table,$mv);
                                if($data_type == 'date' || $data_type == 'datetime' || $data_type == 'timestamp'){
                /*just little piece of formatting of datetime*/
                                    $datetime =  (array)$cv[$mk];
                                    $dt = array_shift($datetime);
                                    $dt = date('Y-m-d h:i:s', strtotime($dt));
                                    $sos_contribution_arr[$mv] = $dt;
                                }else{
                                    $sos_contribution_arr[$mv] = $cv[$mk];
                                }   

                        }
                    }


        /*CATCH ERROR HERE*/
                    Sos_contribution::where('voter_state_id',$sos_contribution_arr['voter_state_id'])
                        ->update($sos_contribution_arr);

                   
              }
        }

Problem:

As I have huge csv file, there might be some typo errors in some column for example here example having some string character in integer column.

So, for example if there are 10 rows and there is an sql error for row 2. this means there is an string character mapped to int column. In that case, it just throws error and halt the process.

But, what I want is not to halt the process, instead record the row number and continuing other row. In this case, store 2 in a variable and continue processing 3-10 and later return that row number.

Is that possible?

What might be the best way to deal with this as later I want to queue this job and later send email to the owner after the completion of job with failed row number.

Example error: SQLSTATE[22018]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Conversion failed when converting the nvarchar value 'abx' to data type tinyint.

24th September, 2018

ssquare started a new conversation Obtain Result In Object Type And In Single Level • 3 weeks ago

My MSSQL procedure

CREATE PROCEDURE PROCEDURE_NAME
AS BEGIN
    SELECT COUNT(*) FROM users
END

Currently calling as $totalData = DB::select('EXEC PROCEDURE_NAME');

and getting result in

<pre>Array
(
    [0] => stdClass Object
        (
            [] => 200000
        )

)
</pre>

Instead of this how can I get 200000 directly in $totalData.

21st September, 2018

ssquare started a new conversation Introducing FOREIGN KEY Constraint 'my_list_user_user_id_foreign' On Table 'my_l Ist_user' May Cause Cycles Or Multiple Cascade Paths. Specify ON DELETE NO ACTION Or ON UPDATE NO ACTION, Or Modify Other FOREIGN KEY Constraints. • 3 weeks ago

I have just moved from mysql to MSSQL server. But, if I try to run migration I received error as follows. [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Introducing FOREIGN KEY constraint 'my_list_user_user_id_foreign' on table 'my_l ist_user' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. (SQL: alter table "my_list_user" add constrai nt "my_list_user_user_id_foreign" foreign key ("user_id") references "users" ("id") on delete cascade)

My migration schema looks lie belows

Users

        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password');
            $table->integer('organization_id')->unsigned();
            $table->foreign('organization_id')->references('id')->on('organizations');
            $table->rememberToken();
            $table->softDeletes();
            $table->timestamps();
        });

My_Lists

        Schema::create('my_lists', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title',255); 
            $table->text('description'); 

            $table->unsignedInteger('created_by');
            $table->foreign('created_by')->references('id')->on('users')->onDelete('cascade');

            $table->softDeletes();
            $table->timestamps();
        });

My_list_user

        Schema::create('my_list_user', function (Blueprint $table) {
            $table->integer('my_list_id')->unsigned()->index();
            $table->foreign('my_list_id')->references('id')->on('my_lists')->onDelete('cascade');


            $table->integer('user_id')->unsigned()->index();
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->primary(['my_list_id', 'user_id']); 
         });

Is that MS SQL does not support even a single level of cascade? How can I solve this?

ssquare left a reply on SQLSTATE[08001]: [Microsoft][ODBC Driver 13 For SQL Server]TCP Provider: No Connection Could Be Made Because The Target Machine Actively Refused It. (SQL: Select Top 1 * From [settings] Where [name] = Site_title And [settings].[deleted_at] Is Null) • 3 weeks ago

Thank you actually I need to make change to SQL server authentication. That is the key what I am missing. Also, as you suggest I need to place drive on both ext folder.

ssquare left a reply on SQLSTATE[08001]: [Microsoft][ODBC Driver 13 For SQL Server]TCP Provider: No Connection Could Be Made Because The Target Machine Actively Refused It. (SQL: Select Top 1 * From [settings] Where [name] = Site_title And [settings].[deleted_at] Is Null) • 3 weeks ago

@staudenmeir I have an update now. If I test with following code.

<?php
$serverName = "(local)";
$connectionInfo = array( "Database"=>"kpi_db","UID"=>"root", "PWD"=>"123456");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}
?>`

It shows following error

Connection could not be established. Array ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'root'. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'root'. ) [1] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'root'. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'root'. ) )

But if I tried with

<?php
$serverName = "DESKTOP-H9OGJE5\MSSQLSERVER";
$connectionInfo = array( "Database"=>"kpi_db","UID"=>"root", "PWD"=>"123456");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}
?>`

I used to got different error Connection could not be established. Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 87 [code] => 87 [2] => [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. [message] => [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. ) [1] => Array ( [0] => HYT00 [SQLSTATE] => HYT00 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired [message] => [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 87 [code] => 87 [2] => [Microsoft][ODBC Driver 13 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [message] => [Microsoft][ODBC Driver 13 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. ) )

Could you get some clue?

ssquare left a reply on SQLSTATE[08001]: [Microsoft][ODBC Driver 13 For SQL Server]TCP Provider: No Connection Could Be Made Because The Target Machine Actively Refused It. (SQL: Select Top 1 * From [settings] Where [name] = Site_title And [settings].[deleted_at] Is Null) • 3 weeks ago

@staidenmeir

DB_CONNECTION=sqlsrv
DB_HOST=DESKTOP-H9OGJE5\MSSQLSERVER
DB_PORT=1433
DB_DATABASE=kpi_db
DB_USERNAME=root
DB_PASSWORD=123456

and

DB_CONNECTION=sqlsrv
DB_HOST=DESKTOP-H9OGJE5\MSSQLSERVER
DB_PORT=1433
DB_DATABASE=kpi_db
DB_USERNAME=sa
DB_PASSWORD=

I have checked with both of this combination and with user root and sa both times gives same result for with port it also shows port and if no port provided it won't display port

ssquare left a reply on SQLSTATE[08001]: [Microsoft][ODBC Driver 13 For SQL Server]TCP Provider: No Connection Could Be Made Because The Target Machine Actively Refused It. (SQL: Select Top 1 * From [settings] Where [name] = Site_title And [settings].[deleted_at] Is Null) • 3 weeks ago

@staudenmeir

without port: "sqlsrv:Server=DESKTOP-H9OGJE5\MSSQLSERVER;Database=kpi_db" With port: "sqlsrv:Server=DESKTOP-H9OGJE5\MSSQLSERVER,1433;Database=kpi_db"

ssquare left a reply on SQLSTATE[08001]: [Microsoft][ODBC Driver 13 For SQL Server]TCP Provider: No Connection Could Be Made Because The Target Machine Actively Refused It. (SQL: Select Top 1 * From [settings] Where [name] = Site_title And [settings].[deleted_at] Is Null) • 3 weeks ago

@staudenmeir I have worked with that too. But with no success. Still returning.

"sqlsrv:Server=DESKTOP-H9OGJE5\MSSQLSERVER;Database=kpi_db"

If you could, I could also screen share with team viewer or so

ssquare left a reply on SQLSTATE[08001]: [Microsoft][ODBC Driver 13 For SQL Server]TCP Provider: No Connection Could Be Made Because The Target Machine Actively Refused It. (SQL: Select Top 1 * From [settings] Where [name] = Site_title And [settings].[deleted_at] Is Null) • 3 weeks ago

@staudenmeir

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:MQ/MXLKOABVwvWjD3G9TgX1v4BO/+bWCez06cuzhYv8=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=sqlsrv
DB_HOST=DESKTOP-H9OGJE5\MSSQLSERVER
DB_PORT=1433
DB_DATABASE=kpi_db
DB_USERNAME=sa
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=database

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

ssquare left a reply on SQLSTATE[08001]: [Microsoft][ODBC Driver 13 For SQL Server]TCP Provider: No Connection Could Be Made Because The Target Machine Actively Refused It. (SQL: Select Top 1 * From [settings] Where [name] = Site_title And [settings].[deleted_at] Is Null) • 3 weeks ago

@technosml ```$serverName = "DESKTOP-H9OGJE5\MSSQLSERVER"; //serverName\instanceName $connectionInfo = array( "Database"=>"kpi_db", "UID"=>"sa", "PWD"=>""); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "Connection established. "; }else{ echo "Connection could not be established. "; die( print_r( sqlsrv_errors(), true)); } ?>`


I got above error. I have created database on sql server using (local). And I don't know I have which username and password on sqlserver I am using username 'sa' and black password as suggesting as default one.

ssquare left a reply on SQLSTATE[08001]: [Microsoft][ODBC Driver 13 For SQL Server]TCP Provider: No Connection Could Be Made Because The Target Machine Actively Refused It. (SQL: Select Top 1 * From [settings] Where [name] = Site_title And [settings].[deleted_at] Is Null) • 3 weeks ago

@staudenmeir Got following error

SQLSTATE[08001]: [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. (SQL: select top 1 * from [settings] where [name] = site_title and [settings].[deleted_at] is null)

ssquare started a new conversation SQLSTATE[08001]: [Microsoft][ODBC Driver 13 For SQL Server]TCP Provider: No Connection Could Be Made Because The Target Machine Actively Refused It. (SQL: Select Top 1 * From [settings] Where [name] = Site_title And [settings].[deleted_at] Is Null) • 3 weeks ago

I am just trying to migrate my laravel to sql server. I have installed Miscrosoft SQL Server. I have downloaded SQL server developer version and make default basic installation.

I am using wamp 64 with php 7.2.4. I have added two extensions in php.ini after I copied them inside wamp64/bin/php/php7.2.4/ext/

extension=php_pdo_sqlsrv_72_ts_x64 extension=php_sqlsrv_72_ts_x64

Now, I can see pdo_sqlsrv in phpinfo.

I have created a database in MSSQL and updated .env file as

DB_CONNECTION=sqlsrv
DB_HOST=DESKTOP-H9OGJE5\MSSQLSERVER
DB_PORT=1433
DB_DATABASE=kpi_db
DB_USERNAME=sa
DB_PASSWORD=

But, unfortunately I am getting this error when I tried to load. Also, I have tried to migrate through artisan command but with no success

   Illuminate\Database\QueryException  : could not find driver (SQL: select * from sysobjects where type = 'U' and name = migrations)

  at C:\wamp64\www\project\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   Doctrine\DBAL\Driver\PDOException::("could not find driver")
      C:\wamp64\www\project\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:50

  2   PDOException::("could not find driver")
      C:\wamp64\www\project\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:46

  Please use the argument -v to see more details.

13th September, 2018

ssquare started a new conversation Jquery Datatable Throws Error As Soon As I Implement Laravel Pagination Links • 1 month ago

@foreach($users as $kv => $vv)
                                    <tr>
                                        <td>{{ $vv -> name}}</td>
                                        <td>{{ $vv-> address}}</td>
                                        <td>{{ city }}</td>
                                        <td> Actions </td>
                                    </tr>
                                    @endforeach
                                    <tr>
                                        <td colspan="100%"> 
                                            {{ $users->links() }}
                                        </td>
                                    </tr>

Error: Cannot set property '_DT_CellIndex' of undefined

After this error, it also does not show datatable's search, sorting and filtering. But as soon as I remove {{$users -> links }} everything works fine.

What I am trying?

I am trying to implement laravel pagination with jquery datatables. As, even serverside jquery datatables took quite long time to process around 30M data. Is there any way to use laravel pagination but jquery datatable's sort, search, and filter?

Any suggestion will be appreciated.

29th August, 2018

ssquare started a new conversation Create A New Table Or Store In Same • 1 month ago

Ok, I have data about different persons. Lets' say people from different states. One states have around 10-15M rows of data. Now, here which one is suitable is it good to make each table for each state or to insert all data in same table.

Could you also explain me the pros and cons of both method.

24th August, 2018

ssquare left a reply on Malformed UTF-8 Characters, Possibly Incorrectly Encoded • 1 month ago

Ok, I have fixed this. Instead of fixing before inserting to database. I convert the charset during reading csv file. So, after that, even on beginning

Dummy Name �zilhis was replaced to Özil

ssquare left a reply on Malformed UTF-8 Characters, Possibly Incorrectly Encoded • 1 month ago

@sirik Yeah, that's my exact requirement. But unfortunately, this also doe snot work.

I have tried to print.

{
         p($cv[$mk]);
        $contribution_data_arr[$mv] = preg_replace("/&([a-z])[a-z]+;/i", "", htmlentities($cv{$mk}));;
}
p($contribution_data_arr);

Here before preg_replace: Dummy Name �zilfter replace:

Array
(
    [name] =>              //Actually here needs to be displayed Ozil
    [home_street_address_1] => YUMA STREET
)

23rd August, 2018

ssquare left a reply on Malformed UTF-8 Characters, Possibly Incorrectly Encoded • 1 month ago

@Sirik Your solutions work with error but Instead It is replacing "Özil" to "zil". This is not what I am seeking.

ssquare left a reply on Malformed UTF-8 Characters, Possibly Incorrectly Encoded • 1 month ago

@tray I am currently using 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci'. Instead of changing, is not there any way to encode it and decode it later querying from database.

ssquare started a new conversation Malformed UTF-8 Characters, Possibly Incorrectly Encoded • 1 month ago

I am tryin to insert data to database using csv. And for this I am doing something like below in a loop

        $data_arr[$mv] = $cv[$mk]; 

Here, there are latin characters on some field. So, it might be displaying this error. So, far I have tried some thing like


$data_arr[$mv] = json_encode($cv[$mk], JSON_UNESCAPED_UNICODE); 

But doing this, changing even integer value to string and that field with latin character is turning empty. How can I tackle this problem.

20th August, 2018

ssquare started a new conversation Need Help To Convert General Sql Query To Query Builder • 1 month ago

Hello guys, my following query is running well. But I am finding it quite difficult to use it as query builder. I am just willing to make equivalent query builder of following:

       /*DONATION RANGE*/
        $donation_range = '1 = 1';
        if($request->donation_range_checkbox){
            $donation_range = "(D.donation_amount >= '".$request->min_donation_amount."' AND D.donation_amount <= '".$request->max_donation_amount."')";
        }else{
            if(trim($request->donation_amount) != ''){
                $donation_range = "D.donation_amount = '".$request->donation_amount."'";    
            }
        }

        /*DURATION*/
        $duration = '1 = 1';
        if($request->period != 'all' ){
            if($request->period == 'custom'){
                $start_date = $request->datestart;
                $end_date = $request->dateend;
                $start_date =  date('Y-m-d', strtotime($request->datestart) );
                $end_date =  date('Y-m-d', strtotime($request->dateend) );
                $duration = "D.donation_date between '".$start_date."' AND '".$end_date."' ";
            }else{
                $duration = "D.donation_date > DATE_SUB('".date('Y-m-d')."', INTERVAL '".$request->duration."' DAY)";
            }
        }

        /*STATE FILTER*/
        $state_filter = '1 = 1';
        $state_arr = array_map( 'trim', explode( ",",$request->state ) );
        $state_arr_str = implode("','",$state_arr);
        if(trim($state_arr_str) != '')
        {
            $state_filter = "B.home_address_state IN ('".$state_arr_str."') OR B.mailing_address_state IN ('".$state_arr_str."')";
        }

        /*CITY FILTER*/
        $city_filter = '1 = 1';
        $city_arr = array_map( 'trim', explode( ",",$request->city ) );
        $city_arr_str = implode("','",$city_arr);
        if(trim($city_arr_str) != '')
        {
            $city_filter = "B.home_address_city IN ('".$city_arr_str."') OR B.mailing_address_city IN ('".$city_arr_str."')";
        }

        /*STREET FILTER*/
        $street_filter = '1 = 1';
        $street_arr = array_map( 'trim', explode( ",",$request->street ) );
        $street_arr_str = implode("','",$street_arr);
        if(trim($street_arr_str) != '')
        {
            $street_filter = "B.home_street_address_1 IN ('".$street_arr_str."') OR B.home_street_address_2 IN ('".$street_arr_str."') OR B.home_street_address_3 IN ('".$street_arr_str."') OR B.mailing_street_address_1 IN ('".$street_arr_str."') OR B.mailing_street_address_2 IN ('".$street_arr_str."') OR B.mailing_street_address_3 IN ('".$street_arr_str."')";
        }

        /*HOME DIRECTION*/
        $home_direction_filter = '1=1';
        if(trim($request->direction) != '')
        {
            $home_direction_filter = "C.home_direction = '".$request->direction."'";
        }

        /*HOUSE NUMBER*/
        $house_number = '1 = 1';
        if($request->house_number_checkbox){
            $house_number = "(C.home_house_number >= '".$request->min_house_number."' AND C.home_house_number <= '".$request->max_house_number."')";
        }else{
            if(trim($request->house_number) != ''){
                $house_number = "C.home_house_number = '".$request->house_number."'";
            }
        }

        /*ZIP CODE FILTER*/
        $zip_code_filter = '1 = 1';
        $zip_code_arr = array_map( 'trim', explode( ",",$request->zip_code ) );
        $zip_code_arr_str = implode("','",$zip_code_arr);
        if(trim($zip_code_arr_str) != '')
        {
            $zip_code_filter = "B.home_address_zip IN ('".$zip_code_arr_str."') OR B.home_address_zip_plus IN ('".$zip_code_arr_str."') OR B.mailing_address_zip IN ('".$zip_code_arr_str."') OR B.mailing_address_zip_plus IN ('".$zip_code_arr_str."')";
        }

        /*GENDER*/
        $gender_filter = '1=1';
        if(trim($request->gender) != '')
        {
            $gender_filter = "B.gender LIKE '".$request->gender."%'";
        }

        /*AGE RANGE*/
        $age = '1 = 1';
        if($request->age_checkbox){
            if($request->min_age){
                $max_birth_year = date('Y') - $request->min_age; //year will be max as opposed to age
            }else{
                $max_birth_year = date('Y');
            }

            if($request->max_age){
                $min_birth_year = date('Y') - $request->max_age; //year will be min as opposed to age
            }else{
                $min_birth_year = 0;
            }

            $age = "(B.birth_year >= '".$min_birth_year."' AND B.birth_year <= '".$max_birth_year."')";
        }else{
            if($request->age){
                $birth_year = date('Y') - $request->age;
                $age = "B.birth_year = '".$birth_year."'";
            }
        }

        /*VOTER PARTY*/
        $party_filter = '1=1';
        if(trim($request->party) != '')
        {
            $party_filter = "B.voter_party LIKE '".$request->party."%'";
        }

        /*TAGS*/
        $tags_filter = '1=1';
        if(trim($request->tags) != '')
        {
            $tags_filter = "N.note_types LIKE '%".$request->tags."%'";
        }

        /*BASE_VOTER_MY_LIST*/
        $my_list_filter = "B.id NOT IN (SELECT M.base_voter_id from base_voter_my_list M where M.my_list_id = '".$my_list_id."')";
        

        $sqlx = "SELECT DISTINCT B.* from base_voter B LEFT OUTER JOIN 
        contribution_data R ON B.contribution_data_table_id = R.id LEFT OUTER JOIN 
        contribution_donation D ON R.id = D.contribution_data_id LEFT OUTER JOIN
        city_voter C ON B.city_voter_table_id = C.id LEFT OUTER JOIN
        notes N ON B.id = N.base_voter_id LEFT OUTER JOIN
        base_voter_my_list M ON B.id = M.base_voter_id
        WHERE (".$donation_range.") AND (".$state_filter.") AND (".$city_filter.") AND (".$street_filter.") AND (".$home_direction_filter.") AND (".$house_number.") AND (".$zip_code_filter.") AND (".$gender_filter.") AND (".$age.") AND (".$party_filter.") AND (".$tags_filter.") AND (".$my_list_filter.")
         ";

17th August, 2018

ssquare started a new conversation Add Content Type Text/html In Sendgrid Mail • 1 month ago

I am following https://sendgrid.com/docs/Integrate/Frameworks/laravel.html this tutorial to send mail using sendgrid. But, I am unable to figure out adding content type text/html how could I do that. Could anyone guide me through this?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.