Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''?php''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Calendários

  • Comunidade iMasters

Todas as áreas do Fórum

  • Q&A Desenvolvimento
    • Perguntas e respostas rápidas
  • Desenvolvimento Web
    • Desenvolvimento frontend
    • Javascript
    • PHP
    • Ruby
    • Python
    • Java
    • .NET
    • Docker, Kubernets e outros ambientes
    • Desenvolvimento com Wordpress
    • Desenvolvimento de apps
    • Desenvolvimento ágil
    • Desenvolvimento de Games
    • Banco de Dados
    • Design e UX
    • Algoritmos & Outras Tecnologias
  • Entretenimento e uso pessoal
    • Segurança & Malwares
    • Geral
    • Boteco iMasters

Encontrar resultados em...

Encontrar resultados que...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


Google+


Hangouts


Skype


Twitter


deviantART


Github


Flickr


LinkedIn


Pinterest


Facebook


Site Pessoal


Localização


Interesses

Encontrado 4 registros

  1. vitaobr

    Grafico no phph com google charts

    Olá pessoal, tenho esse seguinte gráfico mas não consigo alterar para o modo que desejo. Queria que fica-se parecido com o formato: Apresenta-se quantos gols por rodada cada time fez. Obrigado pessoal. <?php $times = array(); $gols = array(); $cantos = array(); $i = 0; $sql = "select * from classificacao"; $resultado = mysql_query($sql); while ($row = mysql_fetch_object($resultado)){ $times[$i] = $row->time1; $gols[$i] = $row->gol1; $rodada[$i] = $row->rodada; $i = $i + 1; } ?> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '0', {'packages':['corechart']}); google.setOnLoadCallback(desenhaGrafico); function desenhaGrafico() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Times'); data.addColumn('number', 'Gols'); data.addColumn('number', 'rodada'); data.addRows(<?php echo $i ?>); <?php $k = $i; for ($i = 0; $i < $k; $i++) { ?> data.setValue(<?php echo $i ?>, 0, '<?php echo $times[$i] ?>'); data.setValue(<?php echo $i ?>, 1, '<?php echo $gols[$i] ?>'); data.setValue(<?php echo $i ?>, 2, '<?php echo $rodada[$i] ?>'); <?php } ?> var options = { width: 650, height: 250, colors: ['#23719F', '#FF9933'], legend: { position: 'top' } }; // cria grafico var chart = new google.visualization.LineChart(document.getElementById('chart_div')); // desenha grafico chart.draw(data, options); } </script> <div id="chart_div"></div>
  2. Diego Coutinho

    Warning: mysqli_query() expects at least 2 parameters,

    Olá gente ! To com esse erro no código , Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\lojaSuplementos\Crud.php on line 21. Sei que na variavel $insert tem que passar 2 variavel mais nao sei como fazer pois a conexão sao de class diferentes. <?php require_once 'Conexao.php'; $con = new Conexao(); class Crud { // atributos public $tabela; //metodos function __construct($tabela ) { $this->tabela = $tabela; } public function inserir($nome,$email,$senha) { $query = "INSERT INTO adm(nome,email,senha) VALUES ('$nome','$email','$senha')"; $insert = mysqli_query($query); if( $insert){ die("Erro na Inserção:". mysqli_errno()); } else { echo "Secesso na Operação"; } } } <?php class Conexao { private $_host = 'localhost'; private $_user = 'root'; private $_pass = ''; private $_database = 'loja'; public $conexao; function __construct(){ $con = mysqli_connect($this->_host, $this->_user, $this->_pass); if($con === false){ die("Erro ao conectar ao servidor &raquo; " . mysql_error()); }else{ $this->conexao = $con; $bd = mysqli_select_db($con, $this->_database) ; if($bd == FALSE){ die ("Não foi possivel acessar o banco de dados;" . mysqli_errno() ); } } } function get_host() { return $this->_host; } function get_user() { return $this->_user; } function get_pass() { return $this->_pass; } function get_database() { return $this->_database; } function getConexao() { return $this->conexao; } function set_host($_host) { $this->_host = $_host; } function set_user($_user) { $this->_user = $_user; } function set_pass($_pass) { $this->_pass = $_pass; } function set_database($_database) { $this->_database = $_database; } function setConexao($conexao) { $this->conexao = $conexao; } }
  3. rafael.munareto

    Recortar com jcrop no php alterando a foto no banco de dados

    Pessoal, No código abaixo quero recortar a foto e subir o nome do arquivo na variável que busco no banco de dados, consegui fazer o efeito de recortar e de visualizar mas não está aparecendo a imagem recortada e nem salvando o nome do arquivo com a nova dimensão, podem me ajudar: <?php error_reporting(E_ALL ^ E_NOTICE); require_once("mostra-alerta.php"); include("coneta_mysql.php"); /** * Jcrop image cropping plugin for jQuery * Example cropping script * @copyright 2008-2009 Kelly Hallman * More info: http://deepliquid.com/content/Jcrop_Implementation_Theory.html */ if ($_SERVER['REQUEST_METHOD'] == 'POST') { $targ_w = $targ_h = 150; $jpeg_quality = 90; $src = "img/perfil/<?php echo $foto_perfil ; ?>"; $img_r = imagecreatefromjpeg($src); $dst_r = ImageCreateTrueColor( $targ_w, $targ_h ); imagecopyresampled($dst_r,$img_r,0,0,$_POST['x'],$_POST['y'], $targ_w,$targ_h,$_POST['w'],$_POST['h']); header('Content-type: image/jpeg'); imagejpeg($dst_r,null,$jpeg_quality); exit; } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="UTF-8"> <title>REDE A</title> <link rel="icon" href="img/logo_pequeno.png"> <link href="css/principal.css" rel="stylesheet" /> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <link href="css/select2.min.css" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=Raleway&display=swap" rel="stylesheet"> <link rel="stylesheet" href="css/bootstrap.min.css"> <script src="js/principal.js"></script> <script src="js/jquery.min.js" type="text/javascript"></script> <script src="js/jquery.Jcrop.js" type="text/javascript"></script> <script src="js/jquery.Jcrop.min.js" type="text/javascript"></script> <link rel="stylesheet" href="css/jquery.Jcrop.css" type="text/css" /> <link rel="stylesheet" href="css/demos.css" type="text/css" /> </head> <script type="text/javascript"> jQuery(function($){ // Create variables (in this scope) to hold the API and image size var jcrop_api, boundx, boundy; $('#cropbox').Jcrop({ onChange: updatePreview, onSelect: updatePreview, aspectRatio: 1 },function(){ // Use the API to get the real image size var bounds = this.getBounds(); boundx = bounds[0]; boundy = bounds[1]; // Store the API in the jcrop_api variable jcrop_api = this; }); function updatePreview(c) { if (parseInt(c.w) > 0) { var rx = 100 / c.w; var ry = 100 / c.h; $('#preview').css({ width: Math.round(rx * boundx) + 'px', height: Math.round(ry * boundy) + 'px', marginLeft: '-' + Math.round(rx * c.x) + 'px', marginTop: '-' + Math.round(ry * c.y) + 'px' }); } }; $(function(){ $('#cropbox').Jcrop({ aspectRatio: 1, onSelect: updateCoords }); }); function updateCoords(c) { $('#x').val(c.x); $('#y').val(c.y); $('#w').val(c.w); $('#h').val(c.h); }; function checkCoords() { if (parseInt($('#w').val())) return true; alert('Please select a crop region then press submit.'); return false; }; }); </script> <body> <main> <?php include("conecta_mysql.php"); require_once("logica-usuario.php"); include("foto_perfil_php.php");?> <div id="outer"> <div class="jcExample"> <div class="article"> <table> <tr> <td> <img id="cropbox" alt="Flowers" src="img/perfil/<?php echo $foto_perfil ; ?>" style="width: 100%; margin-right: 2rem"> </td> <td> <div style="width:100px;height:100px;overflow:hidden;"> <img src="img/perfil/<?php echo $foto_perfil ; ?>" id="preview" alt="Preview" class="jcrop-preview" /> </div> </td> </tr> </table> <form action="alterar_imagem.php" method="post" onsubmit="return checkCoords();"> <input type="hidden" id="x" name="x" /> <input type="hidden" id="y" name="y" /> <input type="hidden" id="w" name="w" /> <input type="hidden" id="h" name="h" /> <input type="submit" value="Recortar" /> </form> <form method="post" enctype="multipart/form-data" name="cadastro"> <input class="btn btn-outline-success" id="escolha_foto" type="file" name="foto"> <button type="file" id="button_perfil" class="btn btn-outline-success" name="upload_foto"> OK </button> <button class="btn btn-outline-success" onclick="refresh()">SAIR</button> </form> </div> </div> </div> </main> </body> <?php include('rodape.php') ?>
  4. JúSP19

    Trocar tabela por variável

    Vocês podem me ajudar? tenho a seguinte linha de código $sql = mysql_query("SELECT * FROM ano2002 ORDER BY id DESC"); ano2002 seria uma tabela do meu banco de dados Eu queria trocar ano2002 por uma variável($exemplo) Tem como fazer isso em php?
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.