insert form em php (Notice: Undefined index:origem)

Estoy realizando um ejercicio de curso, al hacer el formulario para registro me apresenta el error: Notice: Undefined index:. Ya intente de todo hasta escribir todo el codigo de nuevo y sigo com el mismo problema.

<?php   require 'funcs/conexion.php'; var_dump($  _POST);  $  origem = $  _POST['origem'];  $  sql= "INSERT INTO test (origem)  VALUES ($  origem) "; $  resultado= $  mysqli->query($  sql);  if($  resultado){   echo "dados salvo com sucesso"; }else{    echo "erro ao salvar dados"; }  ?> 

Y mi .html desde donde llamo al .php es:

<!DOCTYPE html>   <html lang="en">   <head>     <meta charset="UTF-8">     <title>Document</title>   </head>   <body>     <form action="insertar_test.php" method="post">       <label>origem</label>       <input type="text" name="origem" id="origem">       <button type="submit" class="btn btn-primary" >salvar</button>     </form>   </body> </html> 

ClientContext showing data as undefined

I had some code similar to this one for getting data from property bag.

However, I am getting some error that my variables are undefined. Even site and web are shown as undefined.

What could be the issue?

P.S: My variables usrname and psword are defined globally.

My code is below:

function getPropertyValues(){     var curSite = getCurrentSite();     var context = new SP.ClientContext.get_current();     var web = context.get_web();     var propertyBag = web.get_allProperties();      context.load(propertyBag );     context.executeQueryAsync(Function.createDelegate(this, this.getWebPropertiesSucceeded), Function.createDelegate(this, this.getWebPropertiesFailed)); }  function getWebPropertiesSucceeded() {     usrname = propertyBag.get_fieldValues()["ClientId"];     psword = propertyBag.get_fieldValues()["ClientSecret"]; }  function getWebPropertiesFailed(args, sender) {         //handle errors here   } 

Jquery autocomplete. undefined method

Estoy implementando Jquery Autocomplete. Pero me arroja el siguiente error:

undefined method `product_pro_nombre’ for #Did you mean? product_id_change

mi vista _order_detail_fields.html.erb

    ...     <%= f.hidden_field :product_id, id: 'temp_id', disabled: "disabled" %>     <%= f.autocomplete_field :product_pro_nombre, autocomplete_product_pro_nombre_order_details_path, 'data-showNoMatches' => false, class: "form-control producto", :id_element => '#temp_id', onchange: "setValue(event)" %>     <%= f.hidden_field :product_id, class:"product" %>     ... 

Funciona bien el autocomplete si en lugar de :product_pro_nombre lo dejo como :product_id. Pero al momento de recuperar esta vista para hacer un UPDATE, en lugar del nombre del producto me muestra el ID. Entiendo el porque del error, ya que el product_id es una llave foranea de OrderDetail. Pero no encuentro la forma de recuperar el nombre.

Esta es la documentación que estoy siguiendo https://www.rubydoc.info/gems/rails-jquery-autocomplete/1.0.5

this.TypeError: this.props.items is undefined em React

Pessoal estou tentando fazer um pequeno input em react. Estou tento esse pequeno erro no {this.props.item} Deste de já agradeço a ajuda.

class App extends Component { state={query:”, items:[]}

handleChange=(e)=>{   this.setState({query: e.target.value}) }   handleSubmit=(e)=>{   e.preventDefault()  if(!this.state.query.length){   return   }    const newItem={     query:this.state.query,     id: Date.now()   }   this.setState(state => ({     items: state.items.concat(newItem),     query: ''   }))  } 

render(){

return ( type=’text’ placeholder= ‘Digite sua frase’ onChange={this.handleChange} value={this.state.query} /> Add

    {this.props.items.map(item =>( {item.query}

    ))}

</div> 

); } }

Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos() magento 2

Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos() in /home/hydromarket/public_html/vendor/symfony/polyfill-mbstring/Mbstring.php:500 Stack trace: #0 /home/hydromarket/public_html/vendor/symfony/polyfill-mbstring/bootstrap.php(34): Symfony\Polyfill\Mbstring\Mbstring::mb_strpos('/home/hydromark...', '/home/hydromark...', 0, 'UTF-8') #1 /home/hydromarket/public_html/vendor/magento/framework/Filesystem/Directory/PathValidator.php(60): mb_strpos('/home/hydromark...', '/home/hydromark...') #2 /home/hydromarket/public_html/vendor/magento/framework/Filesystem/Directory/Read.php(82): Magento\Framework\Filesystem\Directory\PathValidator->validate('/home/hydromark...', '/var/.regenerat...', NULL, false) #3 /home/hydromarket/public_html/vendor/magento/framework/Filesystem/Directory/Read.php(210): Magento\Framework\Filesystem\Directory\Read->validatePath('/var/.regenerat...') #4 /home/hydromarket/public_html/vendor/magento/framework/Code/GeneratedFiles.php(66): Magento\Framework\Filesyste in /home/hydromarket/public_html/vendor/symfony/polyfill-mbstring/Mbstring.php on line 500 

I have try run composer require symfony/polyfill-iconv, but it doesn’t work. We are using CENTOS 7.6 xen hvm. Do you have any idea?

Undefined offset: 0

Necesito obtener por medio del id del guest_id su informacion, pero al poner el parametro en postman

localhost:80/isac/apis/users.php?guest_id=3 

Obtengo el siguiente error:

Notice: Undefined offset: 0 in C:\xampp\htdocs\isac\apis\users.php on line 21

Notice: Undefined offset: 0 in C:\xampp\htdocs\isac\apis\users.php on line 22

Notice: Undefined offset: 0 in C:\xampp\htdocs\isac\apis\users.php on line 23

Notice: Undefined offset: 0 in C:\xampp\htdocs\isac\apis\users.php on line 24

Notice: Undefined offset: 0 in C:\xampp\htdocs\isac\apis\users.php on line 25

Notice: Undefined offset: 0 in C:\xampp\htdocs\isac\apis\users.php on line 26

Notice: Undefined offset: 0 in C:\xampp\htdocs\isac\apis\users.php on line 27
{“status”:0,”user”:{“guest_id”:null,”guest_name”:null,”guest_lastName”:null,”guest_phoneNumber”:null,”guest_email”:null,”guest_status”:null,”guest_date”:null}}

<?php       header('Access-Control-Allow-Origin: *');       header('Access-Control-Allow-Methods: GET, POST');       require_once('../apis/connection.php');      if($  _SERVER['REQUEST_METHOD']=='GET')     {       if(isset($  _GET['guest_id']))       {         $  id_user=$  _GET["guest_id"];              $  connection = new MySqlServerConnection();          $  query = 'SELECT guest_id, guest_name, guest_lastName,         guest_phoneNumber,guest_email,guest_status,guest_date          FROM guests WHERE guest_id = ?';         $  result=$  connection->executeQuery($  query, array($  id_user));          if ($  result > 0 )         {           $  user = json_encode(array(                           'guest_id' => $  result[0][0],                           'guest_name' => $  result[0][1],                           'guest_lastName' => $  result[0][2],                           'guest_phoneNumber' => $  result[0][3],                           'guest_email' => $  result[0][4],                           'guest_status' => $  result[0][5],                           'guest_date' => $  result[0][6]                         ));           echo json_encode(array(             'status' => 0,             'user' => json_decode($  user)             ));         }//if         else         {           echo json_encode(array(             'status' => 1,             'errorMessage' => 'user not found'             ));         }//else       }       ?> 

Fatal Error: Call to undefined function is_loaded() in… em Codeigniter (Objetivo: PayPal Payouts)

Estou com o seguinte erro:

Fatal error: Uncaught Error: Call to undefined function is_loaded() in C:\xampp\htdocs\englishup\paypal\codeigniter\system\core\Controller.php:73 Stack trace: #0 C:\xampp\htdocs\englishup\paypal_test.php(7): CI_Controller->__construct() #1 {main} thrown in C:\xampp\htdocs\englishup\paypal\codeigniter\system\core\Controller.php on line 73

Sou novato em php e estou usando a framework do Codeigniter e meu objetivo é “printar” os dados (HTTP_HEADERS) em forma de URI, ou qualquer outra coisa que eu consiga visualizar para ver se o teste em Payouts (forma de pagamento em massa do PayPal) foi executado com sucesso e está funcionando. Seguem abaixo os códigos completos, mas a pasta completa vocês podem encontrar em: https://github.com/angelleye/paypal-codeigniter ou vocês podem estar baixando por aqui, que é o código mais completo ainda: https://www.codeigniter.com/download

paypal_test.php (está na pasta raiz /www)

<?php $  system_path =  "paypal/codeigniter/system"; define('BASEPATH', str_replace("\", "/", $  system_path));      //SE EU DESABILITAR ESTA LINHA APARECE A MENSAGEM DE ERRO "No direct script access allowed" include "paypal/codeigniter/system/core/Controller.php";      //SE EU DESABILITAR ESTA LINHA APARECE O ERRO "Fatal error: Class 'CI_Controller' not found in C:\xampp\htdocs\englishup\paypal\codeigniter\application\controllers\paypal\templates\Payouts.php on line 13" include "paypal/codeigniter/application/controllers/paypal/templates/Payouts.php"; $  bd = new Payouts(); $  print =  $  bd->paypal_payout(); var_dump($  print); ?> 

Payouts.php (Este é o arquivo principal onde quero que apareçam os dados do teste. Está em /www/paypal/codeigniter/application/controllers/paypal/templates/)

<?php  /** * paypal payouts example for php * if it makes things easier for you can buy me a coffee @ paypal > mohandez@hotmail.com * * @package            PHP * @subpackage        Libraries * @category        Libraries * @author            AbdAllah Khashaba * @link            https://khashabawy.com */ //include "../../../../system/core/Controller.php";    //This is the CI_Controller class class Payouts extends CI_Controller {     public function paypal_payout(){         /// PayPal Data         $  mode = "sandbox";  // change to "live" or "sandbox"         $  paypal_app = array(             "mode" => "sandbox",             "sandbox"=> array(                 "client_id"=>"AQZynIyzCG4ypt_0WXAptzkpDrKAJJ2QxqnGdvatCLV0tdy0ZfkX9RQzBUhVAMJnSVfcWTHxeuwuujGx", // change                 "secret"=>"EKaeJASyyiC67xm6D-iPk06-J0HxfzgrU1BvFGUunP4hFRdzSd72PgqiWQhDyCHJulxqZxk-26A9L_iQ",  // change                 "endpoints"=>array(                     "oauth2" => "https://api.sandbox.paypal.com/v1/oauth2/token",                     "payout" => "https://api.sandbox.paypal.com/v1/payments/payouts",                 )             ),             "live"=> array(                 "client_id"=>"xx",  // change                 "secret"=>"yy",  // change                 "endpoints"=>array(                     "oauth2" => "https://api.paypal.com/v1/oauth2/token",                     "payout" => "https://api.paypal.com/v1/payments/payouts",                 )             )                     );         $  client_id = $  paypal_app[$  mode]["client_id"];         $  secret = $  paypal_app[$  mode]["secret"];         $  endpoints = $  paypal_app[$  mode]["endpoints"];         ////// PayOut data                         $  PO_id = mt_rand(100000000000000,999999999999999);  //time();  change         $  PO_amount = 8.00; // change         $  batch = array(             "sender_batch_header" => array(                 "sender_batch_id" => $  PO_id,                 "email_subject" => "You have a payout!",                 "email_message" => "You have received a payout! Thanks for using our service!",             ),             "items" => array(                 0 => array(                     "recipient_type" => "EMAIL",                     "amount" => array(                         "value" => $  PO_amount,                         "currency" => "BRL",                     ),                     "note"=> "Thanks for your patronage!",                     "sender_item_id"=> "201403140001",                     "receiver"=> "rogeriobsoares5-buyer@gmail.com",                 )             )         );         $  batch_data = json_encode($  batch);                 /// Starting OAuth          $  this->load->library("curl");                 $  endpoint = $  endpoints["oauth2"];         $  this->curl->create($  endpoint);         $  this->curl->ssl(FALSE);                 $  this->curl->post("grant_type=client_credentials");         $  this->curl->http_header("Accept","application/json");         $  this->curl->http_header("Accept-Language","en_US");         $  this->curl->http_login($  client_id,$  secret,"client_credentials");         $  returned = $  this->curl->execute();                 //$  this->curl->debug();                 unset($  this->curl);         $  result = json_decode($  returned);          ///// getting Access Token                       $  nonce = $  result->nonce;         $  access_token = $  result->access_token;         $  token_type = $  result->token_type;         $  app_id = $  result->app_id;         $  expires_in = $  result->expires_in;         ///// PayOut Processing         $  this->load->library("curl");                 $  endpoint = $  endpoints["payout"];                 $  this->curl->create($  endpoint);         $  this->curl->ssl(FALSE);                 $  this->curl->http_header("Content-Type","application/json");         $  this->curl->http_header("Authorization","Bearer $  access_token");                 $  this->curl->post($  batch_data);         $  this->curl->http_login($  client_id,$  secret,"client_credentials");         $  returned = $  this->curl->execute();                 //$  this->curl->debug();                 unset($  this->curl);         $  result = json_decode($  returned);         if($  result && $  result->batch_header->batch_status == "PENDING" ){             $  links = $  result->links;             $  link = $  links[0];             $  endpoint = $  link->href;             $  this->load->library("curl");                     $  this->curl->create($  endpoint);             $  this->curl->ssl(FALSE);                     $  this->curl->http_header("Content-Type","application/json");             $  this->curl->http_header("Authorization","Bearer $  access_token");                                 $  returned = $  this->curl->execute();                                 $  result = json_decode($  returned);         }         echo "<pre>";                 print_r($  result);         echo "</pre>";         $  index1 = $  this->index();             } } ?> 

Controller.php (está em /www/paypal/codeigniter/system/core/)

<?php /**  * CodeIgniter  *  * An open source application development framework for PHP  *  * This content is released under the MIT License (MIT)  *  * Copyright (c) 2014 - 2019, British Columbia Institute of Technology  *  * Permission is hereby granted, free of charge, to any person obtaining a copy  * of this software and associated documentation files (the "Software"), to deal  * in the Software without restriction, including without limitation the rights  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell  * copies of the Software, and to permit persons to whom the Software is  * furnished to do so, subject to the following conditions:  *  * The above copyright notice and this permission notice shall be included in  * all copies or substantial portions of the Software.  *  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN  * THE SOFTWARE.  *  * @package CodeIgniter  * @author  EllisLab Dev Team  * @copyright   Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)  * @copyright   Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)  * @license https://opensource.org/licenses/MIT MIT License  * @link    https://codeigniter.com  * @since   Version 1.0.0  * @filesource  */ defined('BASEPATH') OR exit('No direct script access allowed');  /**  * Application Controller Class  *  * This class object is the super class that every library in  * CodeIgniter will be assigned to.  *  * @package     CodeIgniter  * @subpackage  Libraries  * @category    Libraries  * @author      EllisLab Dev Team  * @link        https://codeigniter.com/user_guide/general/controllers.html  */ class CI_Controller {      /**      * Reference to the CI singleton      *      * @var object      */     private static $  instance;      /**      * Class constructor      *      * @return  void      */     public function __construct()     {         self::$  instance =& $  this;          // Assign all the class objects that were instantiated by the         // bootstrap file (CodeIgniter.php) to local class variables         // so that CI can run as one big super object.         foreach (is_loaded() as $  var => $  class)    //O ERRO TÁ AQUI MEUS CAROS, LINHA 73 (is_loaded() não está definida realmente)         {             $  this->$  var =& load_class($  class);         }          $  this->load =& load_class('Loader', 'core');         $  this->load->initialize();         log_message('info', 'Controller Class Initialized');     }      // --------------------------------------------------------------------      /**      * Get the CI singleton      *      * @static      * @return  object      */     public static function &get_instance()     {         return self::$  instance;     }  } ?> 

Fiz uma busca extensiva de cabo a rabo no Google e pelo que vejo, tem muita gente se queixando dos mesmos erros por mim aqui apresentados. Bom, não sei se é pelo fato de eu ser “newbie” em PHP orientado a objetos… Mas como eliminar o erro inicialmente supracitado e fazer a coisa funcionar? Ou será porque o arquivo principal (paypal_test.php) está fora da pasta (/www/paypal/codeigniter/…)? O que vocês acham? Bom já vos disponibilizei todas as ferramentas…

Magento2: custom validation Error “Uncaught TypeError: Cannot read property ‘call’ of undefined”

In my custom validation rules shows ‘

Uncaught TypeError: Cannot read property ‘call’ of undefined’ errors!!!…

. how can i do custom logic and proper validation ?

Here is my Code

app/code/{vendor}/{module}/view/frontend/web/template/form/element/email.html

       <input class="input-text"                type="text"                data-bind="                     textInput: email,                     hasFocus: emailFocused,                     mageInit: {'mage/trim-input':{}}"                name="username"                data-validate="{required:true,'validate-custom-key':true}"                id="customer-email" /> 

app/code/{vendor}/{module}/view/frontend/requirejs-config.js

// JavaScript Document var config = {     map: {         '*': {             script: 'Vendor_Module/js/script'         },         '*': {             'Vendor_Module/js/action/login': 'Vendor_Module/js/action/login'         },         '*': {             'Magento_Checkout/template/form/element/email.html':                 'Vendor_Module/template/form/element/email.html'         }     }, mixins: {         'Magento_Ui/js/lib/validation/validator': {             'Vendor_Module/js/validator-mixin': true         }     } }; 

app/design/frontend/Smartwave/porto/web/js/validator-mixin.js

define([     'jquery' ], function ($  ) {     "use strict";      return function () {         $  .validator.addMethod(             'validate-custom-key',             function (value) {                 // Some custom validation stuff here                 return false;             },             $  .mage.__('Your validation error message')         );     } }); 

jquery.validate.js:556 Uncaught TypeError: Cannot read property ‘call of undefined

at $ .validator.check (jquery.validate.js:556)

at $ .validator.checkForm (jquery.validate.js:372)

at $ .validator.form (jquery.validate.js:359)

at HTMLFormElement. (jquery.validate.js:90)

at HTMLFormElement.dispatch (jquery.js:5226)

at HTMLFormElement.elemData.handle (jquery.js:4878) check @

jquery.validate.js:556 checkForm @ jquery.validate.js:372 form @

jquery.validate.js:359 (anonymous) @ jquery.validate.js:90 dispatch @

jquery.js:5226

elemData.handle @ jquery.js:4878

Magento2: TypeError: $.validator.methods[method] is undefined

I am getting the below error after applying the validation in my form:

Magento2: TypeError: $ .validator.methods[method] is undefined

Here is my validation code:

I have extended the customer address edit form, want to stop the default validation and added my custom validation.

    <?php /**  * Copyright © Magento, Inc. All rights reserved.  * See COPYING.txt for license details.  */  // @codingStandardsIgnoreFile  /** @var \Magento\Customer\Block\Address\Edit $  block */  // 18id="form-validate" ?> <?php $  _company = $  block->getLayout()->createBlock('Magento\Customer\Block\Widget\Company') ?> <?php $  _telephone = $  block->getLayout()->createBlock('Magento\Customer\Block\Widget\Telephone') ?> <?php $  _fax = $  block->getLayout()->createBlock('Magento\Customer\Block\Widget\Fax') ?> <form class="form-address-edit"       action="<?= $  block->escapeUrl($  block->getSaveUrl()) ?>"       id="validate-form"       method="post"        enctype="multipart/form-data">     <fieldset class="fieldset samefield_affecting">         <legend class="legend block-title"><span><?= $  block->escapeHtml(__('Contact Information')) ?></span></legend><br>         <?= $  block->getBlockHtml('formkey') ?>         <input type="hidden" name="success_url" value="<?= $  block->escapeUrl($  block->getSuccessUrl()) ?>">         <input type="hidden" name="error_url" value="<?= $  block->escapeUrl($  block->getErrorUrl()) ?>">         <?= $  block->getNameBlockHtml() ?>          <?php if ($  _company->isEnabled()): ?>             <?= $  _company->setCompany($  block->getAddress()->getCompany())->toHtml() ?>         <?php endif ?>          <?php if ($  _telephone->isEnabled()): ?>             <?= $  _telephone->setTelephone($  block->getAddress()->getTelephone())->toHtml() ?>         <?php endif ?>          <?php if ($  _fax->isEnabled()): ?>             <?= $  _fax->setFax($  block->getAddress()->getFax())->toHtml() ?>         <?php endif ?>      </fieldset>     <fieldset class="fieldset">         <legend class="legend block-title"><span><?= $  block->escapeHtml(__('Address')) ?></span></legend><br>         <?php $  _streetValidationClass = $  this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?>         <div class="field street">             <label for="street_1" class="label">                 <span><?= $  block->escapeHtml(__('Street Address')) ?></span>             </label>             <div class="control">                 <input type="text"                        name="street[]"                        value="<?= $  block->escapeHtmlAttr($  block->getStreetLine(1)) ?>"                        title="<?= $  block->escapeHtmlAttr(__('Street Address')) ?>"                        id="street_1"                        class="input-design input-text <?= $  block->escapeHtmlAttr($  _streetValidationClass) ?>"/>                 <div class="nested">                     <?php $  _streetValidationClass = trim(str_replace('required-entry', '', $  _streetValidationClass)); ?>                     <?php for ($  _i = 1, $  _n = $  this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $  _i < $  _n; $  _i++): ?>                         <div class="field additional">                             <label class="label" for="street_<?= /* @noEscape */ $  _i + 1 ?>">                                 <span><?= $  block->escapeHtml(__('Street Address %1', $  _i + 1)) ?></span>                             </label>                             <div class="control">                                 <input type="text" name="street[]"                                        value="<?= $  block->escapeHtmlAttr($  block->getStreetLine($  _i + 1)) ?>"                                        title="<?= $  block->escapeHtmlAttr(__('Street Address %1', $  _i + 1)) ?>"                                        id="street_<?= /* @noEscape */ $  _i + 1 ?>"                                        class="input-design input-text">                             </div>                         </div>                     <?php endfor; ?>                 </div>             </div>         </div>          <?php if ($  this->helper('Magento\Customer\Helper\Address')->isVatAttributeVisible()) : ?>             <div class="field taxvat">                 <label class="label" for="vat_id">                     <span><?= $  block->escapeHtml(__('VAT Number')) ?></span>                 </label>                 <div class="control">                     <input type="text"                            name="vat_id"                            value="<?= $  block->escapeHtmlAttr($  block->getAddress()->getVatId()) ?>"                            title="<?= $  block->escapeHtmlAttr(__('VAT Number')) ?>"                            class="input-design input-text"                            id="vat_id">                 </div>             </div>         <?php endif; ?>         <div class="field city">             <label class="label" for="city"><span><?= $  block->escapeHtml(__('City')) ?></span></label>             <div class="control">                 <input type="text"                        name="city"                        value="<?= $  block->escapeHtmlAttr($  block->getAddress()->getCity()) ?>"                        title="<?= $  block->escapeHtmlAttr(__('City')) ?>"                        class="input-design input-text"                        id="city">             </div>         </div>         <div class="field region">             <label class="label" for="region_id">                 <span><?= $  block->escapeHtml(__('State/Province')) ?></span>             </label>             <div class="control">                 <select id="region_id" name="region_id"                         title="<?= $  block->escapeHtmlAttr(__('State/Province')) ?>"                         class="select_img validate-select" <?= /* @noEscape */ !$  block->getConfig('general/region/display_all') ? ' disabled="disabled"' : '' ?>>                     <option value=""><?= $  block->escapeHtml(__('Please select a region, state or province.')) ?></option>                 </select>                 <input type="text"                        id="region"                        name="region"                        value="<?= $  block->escapeHtmlAttr($  block->getRegion()) ?>"                        title="<?= $  block->escapeHtmlAttr(__('State/Province')) ?>"                        class="input-design input-text "<?= !$  block->getConfig('general/region/display_all') ? ' disabled="disabled"' : '' ?>/>             </div>         </div>         <div class="field zip">             <label class="label" for="zip">                 <span><?= $  block->escapeHtml(__('Zip/Postal Code')) ?></span>             </label>             <div class="control">                 <input type="text"                        name="postcode"                        value="<?= $  block->escapeHtmlAttr($  block->getAddress()->getPostcode()) ?>"                        title="<?= $  block->escapeHtmlAttr(__('Zip/Postal Code')) ?>"                        id="zip"                        class="input-design input-text">             </div>         </div>         <div class="field country">             <label class="label" for="country"><span><?= $  block->escapeHtml(__('Country')) ?></span></label>             <div class="control">                 <?= $  block->getCountryHtmlSelect() ?>             </div>         </div>          <?php if ($  block->isDefaultBilling()): ?>             <div class="message info">                 <span><?= $  block->escapeHtml(__("It's a default billing address.")) ?></span>             </div>         <?php elseif ($  block->canSetAsDefaultBilling()): ?>             <div class="field choice set billing">                <label class="submit_head phone_rig yes" for="primary_billing">              <input class="input-design"  type="checkbox" id="primary_billing" name="default_billing" value="1" class="checkbox"><?= $  block->escapeHtml(__('Use as my default billing address')) ?>               <span class="submit_class"></span>            </label>              </div>         <?php else: ?>             <input type="hidden" name="default_billing" value="1" />         <?php endif; ?>          <?php if ($  block->isDefaultShipping()): ?>             <div class="message info">                 <span><?= $  block->escapeHtml(__("It's a default shipping address.")) ?></span>             </div>         <?php elseif ($  block->canSetAsDefaultShipping()): ?>             <div class="field choice set shipping">                 <label class="submit_head phone_rig yes" for="primary_shipping">          <input class="input-design" type="checkbox" name="default_shipping"           id="primary_shipping" checked="checked" value="1"><?= $  block->escapeHtml(__('Use as my default shipping address')) ?>                  <span class="submit_class"></span>                </label>               </div>         <?php else: ?>             <input type="hidden" name="default_shipping" value="1">         <?php endif; ?>     </fieldset>     <div class="actions-toolbar">         <div class="primary save_add">             <button type="submit"                     class="action submit primary save_width"                     data-action="save-address"                     title="<?= $  block->escapeHtmlAttr(__('Save Address')) ?>">                  <?= $  block->escapeHtml(__('Save Address')) ?>              </button>         </div>         <div class="secondary">             <a class="action back" href="<?= $  block->escapeUrl($  block->getBackUrl()) ?>">                 <span><?= $  block->escapeHtml(__('Go back')) ?></span>             </a>         </div>     </div> </form>  <style type="text/css">  .fieldset>.field.required>.label:after, .fieldset>.fields>.field.required>.label:after, .fieldset>.field._required>.label:after, .fieldset>.fields>.field._required>.label:after {     font-size: 18px !important;     margin: 0px !important;     padding: 0px 3px 0px 3px !important;     top: 5px !important;     position: relative; } .fieldset>.field .additional, .fieldset>.fields>.field .additional {     margin-top: 20px; } div.mage-error[generated] {     color: #ff0000;     font-size: 14px;     position: absolute;     margin-top: 0px !important;     font-weight: 700; } @media(max-width: 767px) { .actions-toolbar,legend.legend.block-title {     margin: 20px 0; }  }   #country option:nth-child(3){      display: none; } </style>  <script type="text/javascript"> require([     'jquery',     'jquery/validate' ], function(jQuery) {      jQuery(document).ready(function()     {       alert("Amy11");          jQuery("#validate-form").validate(         {             rules:              {                 firstname: {                     required:true                 },                 lastname: {                    required:true                 },                  telephone: {                    required:true                 },                  "street[]": {                    required:true                 },                    country_id: {                    required:true                 },                  city: {                    required:true                 },                  postcode: {                    required:true                 },              },             messages:              {                  firstname: "Please enter your First Name",                 lastname: "Please enter your Last Name",                 telephone: "Please enter your Phone Number",                 "street[]": "Please enter your Street",                 country_id: "Please enter your Country",                 city: "Please enter your City",                 postcode: "Please enter your Zip/Postal Code",             },             submitHandler: function(form, event)              {                  event.preventDefault();                 //console.log("aaaaaaaaaaa");                 form.submit();              }         });      });  });  </script> 

Any help would be appreciated.

Android sqlite resultado undefined

En una app de android (android studio) estoy guardando fotos convertidas a string base64 en una base de datos sqlite. Se guardan correctamente. Si extraigo la base de datos y la consulto con un editor de base de datos está guardada correctamente.

Pero cuando hago un select el resultado me devuelve es undefined.

 c = db.rawQuery("SELECT Photo FROM photo"                 , null);         if (c.moveToFirst()) {             do {                 c.getString(0);             } while (c.moveToNext());         } 

si evaluo ese c.getString me devuelve undefined. Pero si hago

c = db.rawQuery("SELECT COUNT (Photo) FROM photo"             , null);     if (c.moveToFirst()) {         do {             c.getInt(0);         } while (c.moveToNext());     } 

este getInt me devuelve 1

¿Como puedo recuperar el texto?