PHP

121K

Solutions

33K

Contributors

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

Share tech news, updates, or what's on your mind.

Sign up to Post

Contact form was working fine then it stopped,  Any help is appreciated. Thank you.

https://www.alessandrocoli.com/#contactcontact.php
0
Hi Experts


Could you point a Laravel library to send an email after an action?

After an user sends an image to be shown at a vitrine it must to be approved/ reproved by the admin and then an email must to be automatically sent to the user relating the result.

Thanks in advance
0
Hi Experts

Could you point what is needed to be adjusted at this Laravel code to correctly call the Controller method?

The link is at the site's main page:

img003
@if($vitrinesX->count()>0)
	 <div class="col-md-12">
	 
		<img src="{{ $vitrinesX[0]->url }}" />
		<br />
		 
		 
		 <div class="col-md-12" style="padding-top: 9px;">
			
			<a href="/vitrine?id={{ $vitrinesX[0]->id }}">
				ver todas as fotos
			</a>
			<br />
			
			<!-- Route that must to be called -->
			<a href="/vitrine/minhasfotos">
				ver minhas fotos
			</a>
			 <br />
			
		</div>
	</div>

@else
	<div class="col-xs-12 col-sm-12 col-md-12">
		<div class='alert alert-info'>
			Nenhuma vitrine cadastrada, ativa ou aprovada.
		</div>
	</div>
@endif

Open in new window



Route:
Route::get('/vitrine/minhasfotos',['uses'=>'VitrinesController@minhasFotos'])->middleware('cadastro');

Open in new window


Then a 2nd page must to be oppened with only the images owned by the logged user.


The Controller is not called.

Thanks in advance.
0
Hi Experts

Could you point how to refresh data at a Laravel view when data to be presented changes ?

When the page is initially presented it shows all the images.

Then a filter is applied and the collection to be presented is much smaller. The view is called the same way it was for all the images, but the images presented are not actualized.

If the view is started with the data filtered it's correctly presented.

Thanks in advance.
0
Hi Experts


Could you point what must to be adjusted at this Laravel Eloquent code to filter only the elements from "Vitrine" that belongs to the logged user_id?

Accordingly to:
img014

My attempt (incorrect) was

$vitrinesX = Vitrine
			::with('user_vitrine')
			->ativa()
			->aprovada()
			->global(Auth::user()->tipoparticipante_id)
			->orderBy('id','desc')
			->withCount([
				'user_vitrine as qtdeCurtiu' => function (Builder $query) { $query->where('curtiu', 1); },
			])
			->where('user_id', auth()->user()->id)
			->paginate(3);

Open in new window



Thanks in advance
0
Hi Experts

Could you point why a Laravel Controller method produces an error when another similar runs correctly?

Accordingly to:

JS
function Vitrine() {}
 

//OK
Vitrine.prototype.salvar = function(){
  
  $.ajax({
    url: '/vitrine/salvar',
    
    method: "POST",
    data: {
      _token: $('input[name="_token"]').val(),
      id: $('#id').val(),
      url: $('#url').val(),
      inicio: $('#inicio').val(),
      termino: $('#termino').val(),
      title: $('#title').val(),
      description: $('#description').val(),
      points: $('#points').val()
    },
    error:function(data){
      hotsite.openModalCustom("Erro", data.responseText, "Entendi", "error");
    },
    success: function(data){
      hotsite.openModalCustom("Sucesso ao salvar", data.retorno, "Entendi", "success");
      hotsite.closeModal('mEditor');
      //hotsite.vitrine.filtrar();
    }
  });
};


// This doesn't runs correctly
Vitrine.prototype.minhasfotos = function(){
  $.ajax({
    url: '/vitrine/minhasFotos',
    method: "GET",
    dataType: "html",
    error:function(data){
      hotsite.openModalCustom("Erro", "Erro ao carregar vitrine.", "Entendi", "error");
    },
    success: function(data){
      $('#midiaList').html(data);
    }
  });
}

Open in new window



Laravel routes:
Route::post('/vitrine/salvar',['uses'=>'VitrinesController@salvar'])->middleware('cadastro');   // OK
Route::post('/vitrine/minhasfotos',['uses'=>'VitrinesController@minhasFotos'])->middleware('cadastro');  //NOK

//This route apparently is called somehow....
Route::get('/vitrine/{id}/obter',['uses'=>'admin\VitrineController@obter'])->middleware('cadastro');

Open in new window



VitrinesController methods:

Open in new window

0
Hi Experts


Could you point how to configure this Bootstrap buttons to be correctly distributed accordingly with this layout?

img010

<div class='row'>

      <div class="panel panel-primary">
      
          <div class='row'>
          
            <div class='col-md-8 pull-right'>
              <div class="btn-group" role="group">
                <button type="button" class="btn btn-primary" onclick="hotsite.vitrine.novo();">
                  <i class="fas fa-video" aria-hidden="true"></i> Minhas Fotos
                </button>
              </div>
            </div>
            
            <div class='col-md-6 pull-right'>
              <div class="btn-group" role="group">
                <button type="button" class="btn btn-primary" onclick="hotsite.vitrine.novo();">
                  <i class="fas fa-video" aria-hidden="true"></i> Todas as Fotos
                </button>
              </div>
            </div>
              
            <div class='col-md-4 pull-right'>
              <div class="btn-group" role="group">
                <button type="button" class="btn btn-primary" onclick="hotsite.vitrine.novo();">
                  <i class="fas fa-video" aria-hidden="true"></i> Enviar Foto
                </button>
              </div>
            </div>
              
          </div>  
       
    </div>
</div>

Open in new window


Thanks in advance!
0
Hi Experts


Could you point what's needed to change from video upload to image/photo upload on this view?

Accordingly to this code:

<div id='box-video' class='col-md-5 text-center'>

	<video controls style='width: 100%'>
		<source id='srcVitrine' src='' />
	</video>
	
	// Change to:
	<img controls style='width: 100%'>
		<source id='srcVitrine' src='' />
	</img>
	

	<div class='col-md-12 form-group'>
		<label for='titulo'>URL (Vídeo):</label>
		<div class="input-group">
			<input type='text' id='url' name='url' disabled class='form-control'/>
			<span class="input-group-btn">
				<button class="btn btn-primary" type="button" onclick='hotsite.vitrine.subirVideo();'><i class="fa fa-camera"></i></button>
			</span>
			<input type='file' id='file' name='file' style='display:none;'/>
		</div>
	</div>
</div>


<script>
  var jqXHRData;
  $(document).ready(function() {

    
    var pars = {
        _token:$('input[name="_token"]').val()
    };

    var resultImageUpload = function (data) {
        if (!data.result.erro) {
            localizacao = data.result.retorno.localizacao;
            $('#url').val(localizacao);
            $('#srcVitrine').attr('src', localizacao);
            
			
			// This runs
			$("#box-video video")[0].load();
			
			// This doesn't run
            $("#box-video img")[0].load();
					
            return false;
        } else {
          hotsite.openModalCustom("Erro",'Erro ao subir vídeo.', "Entendi", "error");
          return false;
 

Open in new window

0
Hi Experts

Could you point how to correctly use Laravel's paginate method at this code?

    $vitrinesX = Vitrine
           ::with('user_vitrine')
	   ->ativa()
	->aprovada()
	->global(Auth::user()->tipoparticipante_id)
	->orderBy('id','desc')
	->withCount([
		'user_vitrine as qtdeCurtiu' => function (Builder $query) { $query->where('curtiu', 1); },
		//'user_vitrine as naocurtiu' => function (Builder $query) { $query->where('curtiu', 0); }
	])
	->get()->paginate(5)
	->each(function($vitrine) {
		$vitrine->liked_by= $vitrine->user_vitrine->pluck('id');
	});

Open in new window


Produces this error:

img001
Thanks in advance.
0
I'm trying to get things done quick.

I'm working on a Laravel project, I realize I need to alter the structure of a table so I just go into phpMyAdmin, do what needs to be done and then alter the corresponding migration file.

You're not supposed to do that, are you?

In the interest of keeping the migration file current, I just changed the schema. But then I began to wonder if that wasn't going to throw things off systemically and now, things are all cornfused.

First of all, just for the sake of my own edification: Migrations are not optional. Regardless of how incremental of a change you're making to your database, it all has to be done through the migration dynamic because that's a part of the way Larevel / Eloquent are processing things, correct?

Secondly, for the sake of cleaning up the mess i just described, here's what I did:

I created a "drop_video_table" migration and ran that successfully.
Here's the "create_videos_table" migration that I edited (perhaps incorrectly)

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVideosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('videos', function (Blueprint $table) {
            $table->bigIncrements('id');
			$table->string('title');
			[b]$table->binary('description');
			

Open in new window

0
I am sending form data to a 3rd party API but get this error:

HTTP/1.1 415 Cannot process the message because the content type 'application/x-www-form-urlencoded' was not the expected type 'text/xml; charset=utf-8'

So, I am trying to troubleshoot by sending the data via Postman but getting the same error. Not really sure how to resolve this? I have been trying to change the content type to text and xml etc. but still keep getting similar errors.

In the headers I have:

Content-Type : application/xml

Not sure if that needs to change
0
I need to run a php file in the background by clicking a input type button
without navigating away from the page that the button is placed

The php file have the following headers (basically it will prompt a file generated download)
I have no information to post.

I also would like to know in the php file which prompts the download of the file, if I can save a copy of the file on the server at the same time? how would I do this ?
	// output headers so that the file is downloaded rather than displayed
	header('Content-type: text/csv');
	header('Content-Disposition: attachment; filename="demo.csv"');

	// do not cache the file
	header('Pragma: no-cache');
	header('Expires: 0');

Open in new window

0
I have a 9 digit number showing 3.14E+08 when exporting to CSV using fputcsv();
I tried to turn into a string which worked but quotes appeared which is also no good
any suggestions ?
$val = 123456789
$val = "'" . $val . "'"

Open in new window

0
Hi Experts

Could you point why this HTML textarea is not actualized when changing the pictures since JS scripts shows it has changed?

Accordingly to:

 img002
What occurs is:
img003
Page Code:
  <div class="modal fade" id="mMidiaEditar" tabindex="-1" role="dialog" aria-labelledby="mMidiaEditarLabel">
    <div class="modal-dialog modal-lg" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="mMidiaEditarLabel">Mídia</h4>
        </div>
        <div class="modal-body">
          {{ csrf_field() }}
          <input type='hidden' id='id'/>
          <div class='form-group'>
            <label for='tituloEditar'>Título:</label>
            <input type='text' class='form-control' id='tituloEditar' name='tituloEditar'/>
          </div>

<!--  --->
          <div class='form-group'>
            <label for='descricaoEditar'>Descrição X:</label>
            <textarea class='form-control' id='descricaoEditar' name='descricaoEditar' rows="5"></textarea>
          </div>
<!--  --->

          <div class='form-group'>
            <label for='tipoparticipanteEditar'>Perfil:</label>
            <select id='tipoparticipanteEditar' name='tipoparticipanteEditar' class='form-control'>
              <option value='0'>Para todos os 

Open in new window

0
I was adding some php file uploader to my Microsoft server 2016.  I had the software company dial into the server to help look at config and now all my sites are down and it only shows a http 500 error?  And no matter what I change around I can't get the sites to give me any error messages or anything.  I am unable to reach the software support people today for some reason and need to get the sites back up.  Any clue on a way to troubleshoot this?

Main site is using .asp, and I added php which seemed to be working also.  I just don't know if somehow the rights got changed? even the files with .html won't work either?
0
Hey there,  I have a PHP session cookie on our site which sets when a visitor comes to our site from a paid ad, and follows them through the site, and passes the variable to our CRM when they fill out a form.

See the PHP code below. Works!

function set_ad_cookies() {
	
	$vars = array('wordpress_sourcetagji');
	foreach ($vars as $k) {
		if (isset($_GET[$k]) && !isset($_COOKIE[$k])) {
			setcookie($k, $_GET[$k], 0, '/', $domains['cookie_domain']);
		}
	}
	
	  if (!isset($_COOKIE['wordpress_sourcetagji'])) {
		setcookie('wordpress_sourcetagji', $_GET['wordpress_sourcetagji'], 0, '/', $domains['cookie_domain']);
	  }
  }
  add_action('init', 'set_ad_cookies');

Open in new window


We are now finding that caching is stripping the cookie value when they navigate to a different page. Flywheel have said that this will happen as it's php and need to keep the caching on, and the only solution is to create the cookie in JS.

I've got very basic js skills, so how could i convert the above PHP code into JS so that   Scenario :
User1 comes into the site from an ad  https://mysite.com/?wordpress_sourcetagji=this-monster-cookie
User 1 visits varous pages on our site, and then fills out a form.
Cookie is still active and keeps it's value until the session ends.
0
Hi Experts

Could you point a eay to present a photo by giving its url location by using PHP/ Laravel?

Accordingly with

<div class="box-noticias">
	<a href="javascript:void(0);" onclick='....;' >
	{{$vitrine->url}}
	</a>                    
</div>

Open in new window


Actually the{{$vitrine->url}}  presents the url itself, something like:

https://xxxxx.blob.core.windows.net/xxx/vitrines/87w91898.BMP

So I need to render it to show as a image.

Thanks in advance.
0
Been up for 18+ hours getting a script ready for a non-profit that I do pro-bono work for and having difficulty seeing the forest for the trees. ;-)
I have this JSON being returned from my DB:
    [{"sponsorship1":"1","sponsorship2":"1","sponsorship3":"1","sponsorship4":"0","sponsorship5":"1","sponsorship6":"0","sponsorship7":"1","sponsorship8":"1","sponsorship9":"1","sponsorship10":"1","sponsorship11":"1","sponsorship12":"1"},
     {"sponsorship1":"0","sponsorship2":"0","sponsorship3":"0","sponsorship4":"0","sponsorship5":"0","sponsorship6":"0","sponsorship7":"0","sponsorship8":"0","sponsorship9":"0","sponsorship10":"0","sponsorship11":"0","sponsorship12":"1"},
     {"sponsorship1":"0","sponsorship2":"0","sponsorship3":"0","sponsorship4":"0","sponsorship5":"0","sponsorship6":"0","sponsorship7":"0","sponsorship8":"0","sponsorship9":"0","sponsorship10":"0","sponsorship11":"0","sponsorship12":"1"},
     {"sponsorship1":"0","sponsorship2":"0","sponsorship3":"0","sponsorship4":"0","sponsorship5":"0","sponsorship6":"0","sponsorship7":"0","sponsorship8":"0","sponsorship9":"0","sponsorship10":"0","sponsorship11":"0","sponsorship12":"1"},
     {"sponsorship1":"0","sponsorship2":"0","sponsorship3":"0","sponsorship4":"0","sponsorship5":"0","sponsorship6":"0","sponsorship7":"0","sponsorship8":"0","sponsorship9":"0","sponsorship10":"0","sponsorship11":"0","sponsorship12":"0"},
     

Open in new window

0
I'm creating a table in Laravel. I created both my Model and my Migration using:

php artisan make:model Video -m

That resulted in a new Migration file called, "2020_02_13_023156_create_videos_table.php" which looks like this:

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVideosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('videos', function (Blueprint $table) {
            $table->bigIncrements('id');
			$table->string('title');
			$table->binary('code');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('videos');
    }
}

Open in new window


Perfect!

Now, I want to add that table to the database, so I run this:

$ php artisan migrate --path=database/migrations/2020_02_13_023156_create_videos_table

...and I get an error that says, "Nothing to migrate."

So, I'm looking at what appears to be a sound approach, but there's no "videos" table in the databsae.

What am I missing?
0
Hello,
We have recently upgraded to php 7.4 for our intranet on windows 10 and we are getting a database not found error. All the files for the database are there and should be in working order. Everything worked fine on 7.3 with Windows 7.The log files do not give any hints as to why the database isn't being found. Does anyone know of anything that would have changed between versions?

Thanks
0
Hi Experts

Could you point why a Controller method code is subtly returning to a jquery ajax without running and returning OK to JS ?

Accordingly to:

Vitrine.prototype.salvar = function(){
    
  console.log ('JS salvar');
  
  $.ajax({
    url: '/vitrine/salvar',
    
    method: "POST",
    data: {
      _token: $('input[name="_token"]').val(),
      id: $('#id').val(),
      url: $('#url').val(),
      inicio: $('#inicio').val(),
      termino: $('#termino').val(),
      title: $('#title').val(),
      description: $('#description').val(),
      points: $('#points').val()
    },
    error:function(data){
      hotsite.openModalCustom("Erro", data.responseText, "Entendi", "error");
    },
    success: function(data){
      hotsite.openModalCustom("Sucesso ao salvar", data.retorno, "Entendi", "success");
      hotsite.closeModal('mEditor');
      //hotsite.vitrine.filtrar();
    }
  });
};

Open in new window


and Controller method:


 public function salvar(Request $request){
   
	 //Forcing an error
	 //aaa;
	
	
	// Otherwise subtly exit with no traces.
	info('xxx');
   
	dd('aaa');

	$id=$request->input('id');
	$url=$request->input('url');
	$inicio=$request->input('inicio');
	$termino=$request->input('termino');

	$titulo = $request->input('title');
	$descricao = $request->input('description');
	$pontuacao = $request->input('points');

	try{
		if($id != '' &&  $id > 0){
		  $vitrine = Vitrine::find($id);
		}

		if(empty($vitrine)){
		  $vitrine = new Vitrine();
		  $vitrine->created_at=new \DateTime();
		}
			
		$vitrine->title = $titulo;
		$vitrine->description = $descricao;
		$vitrine->points = CustomFuncs::brancoParaNulo($pontuacao);
		$vitrine->url = $url;
		$vitrine->validity_start = empty($inicio) ? null : CustomFuncs::formatarDataUS($inicio);
		$vitrine->validity_end = empty($inicio) ? null : CustomFuncs::formatarDataUS($termino);
		$vitrine->updated_at=new \DateTime();
		
		info($vitrine);
		
		
		$vitrine->save();

	} catch (\Exception $e) {
		return response()->json(new Resultado(true,'','Erro ao salvar o vídeo'), 400);
	}

	return response()->json(new Resultado(false,'','Vídeo cadastrado com sucesso'));

}

Open in new window



The forced error:

img015
Thanks in advance!
0
Hi Experts


Could you clear why this Controller method isn't called as expected?

Accordingly with a previous question this form have 02 phases

1st: Upload a picture to a defined path - In my tests by using  
use Illuminate\Support\Facades\Storage;

Open in new window

It's perfectly locally uploaded.


2nd  The image url and details must to be saved at the table Vitrines

So, this method is called

Vitrine.prototype.salvar = function(){
    
  console.log ('JS salvar');  // Pass here
  
  $.ajax({
    url: '/admin/vitrine/salvar',
    method: "POST",
    data: {
      _token: $('input[name="_token"]').val(),
      id: $('#id').val(),
      url: $('#url').val(),
      inicio: $('#inicio').val(),
      termino: $('#termino').val(),
      title: $('#title').val(),
      description: $('#description').val(),
      points: $('#points').val()
    },
    error:function(data){
      hotsite.openModalCustom("Erro", data.responseText, "Entendi", "error");
    },
    success: function(data){
      hotsite.openModalCustom("Sucesso ao salvar", data.retorno, "Entendi", "success");
      hotsite.closeModal('mEditor');
      //hotsite.vitrine.filtrar();
    }
  });
};

Open in new window


img008
This method is configured at routes

Route::post('/admin/vitrine/salvar',['uses'=>'admin\VitrineController@salvar'])->middleware('cadastro');

Open in new window


But it doesn't seen it's called at VitrineController

 public function salvar(Request $request){
 
       

Open in new window

0
Hey There,

I need a little help tweaking my script for determining a State based on a Phone Number areacode.

I have a form, which when you enter the phone number, a hidden field will be populated with the state.   The script is working if you enter the number in 111-111-1111 or 111111111 format, but if you do (111)-111-1111 or (111)111-1111 format, it displays none.  So How do i tweak this, so it will pull the state regardless of the format.  Website here - Website

form html
<div class="rounded-lp-form">
<div class="lp-form-header">
		<h1 style="text-align: center;">Schedule a demo</h1>
		<p style="text-align: center;"><span class="text-black">Already an existing customer?</span><br />
			<a href="https://buildertrend.com/company/contact-us/">Contact us here.</a>
		</p>
  </div>
  <form id="scedule-demo-lp-form" class="" action="https://go.buildertrend.com/l/464372/2020-02-04/7lw3vg" method="get">

<div>
    <input type="text" id="full_name" name="full_name" required placeholder="Full name" required/>
    <label for="full_name" class="hide-label">Full Name</label>
 </div>  
  <div>
    <input type="email" id="email" name="email" required placeholder="Email address" />
    <label for="email" class="hide-label">Email Address</label>
  </div>
  
<div>
	<input name="phone" id="phone" type="tel" placeholder="Phone number" required>
	<label for="phone" 

Open in new window

0
Hi Experts

Could you give me directions on how this JS uploading photo method is running?

-- web page script

<script>
  var jqXHRData;
  $(document).ready(function() {
    ZZZsite.video.filtrar();
    var pars = {
        _token:$('input[name="_token"]').val()
    };

    var resultImageUpload = function (data) {
        if (!data.result.erro) {
            localizacao = data.result.retorno.localizacao;
            $('#url').val(localizacao);
            $('#srcVideo').attr('src', localizacao);
            $("#box-video video")[0].load();
            return false;
        } else {
          ZZZsite.openModalCustom("Erro",'Erro ao subir vídeo.', "Entendi", "error");
          return false;
        }
    };

    var failImageUpload = function (data) {
          if (data.files[0].error) {
              ZZZsite.openModalCustom("Erro",'Erro ao subir vídeo.', "Entendi", "error");
              return false;
          }
    };

// --- DOES THIS PART ASKS TO SAVE ON A PATH (???)
    ZZZsite.InitFileUpload("file", "/admin/videos/salvarVideo", pars, resultImageUpload, failImageUpload);
//----------------------------------------


    $("#file").change(function () {
        if (jqXHRData) {
            jqXHRData.submit();
        }
        return false;
    });
  })
</script>

Open in new window



-- JS script
ZZZsite.prototype.InitFileUpload = function(
  input,
  url,
  pars,
  doneCallbackFunction,
  failCallbackFunction
) {
  "use strict";

  $("#" + input).fileupload({
    url: url,
    formData: pars,
    dataType: "json",
    type: "POST",
    add: function(e, data) {
      jqXHRData = data;
    },
    done: function(event, data) {
      if (
        doneCallbackFunction != undefined &&
        typeof doneCallbackFunction == "function"
      ) {
        doneCallbackFunction(data);
      } else {
        ZZZsite.openModalCustom("Erro", data, "Entendi", "error");
      }
    },
    fail: function(event, data) {
      if (
        failCallbackFunction != undefined &&
        typeof failCallbackFunction == "function"
      ) {
        failCallbackFunction(data);
      } else {
        ZZZsite.openModalCustom("Erro", data, "Entendi", "error");
      }
    }
  });
};

Open in new window



img001



At VideoController I found the method SalvarVideo ... (called at the page)

   public function salvarVideo(Request $request){
        $video=$request->file('file');

        if (!$request->hasFile('file')){
            $resultado=new Resultado(true,"","Nenhum arquivo foi selecionado.");
            return response()->json($resultado);
        } else {			
            $videoUrl = AzureStorage::saveFile($video,'videos');
        }

        $output = array(
            "localizacao" => $videoUrl,
        );

        $resultado=new Resultado(false,"",$output);

        return response()->json($resultado);
    }

Open in new window


After choosing a photo the textbox is filled with a location very unclear.

Since I'm still developing and need to test it, the correct here is to create a defined path to save the photo image file?

Thanks in advance!
0
I am trying to import a .sql into a blank database in PHPMyAdmin
The Collation is utf8_unicode_ci

The database tables in the .sql file are:
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

I get a collation error telling me that the collation format is unrecognised

How do I proceed with this, please?
0

PHP

121K

Solutions

33K

Contributors

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.