Questions tagged as 'php'

3
answers

Get last auto increment PDO key

I have a problem with my system that looks like this, try { $sql = "SELECT Nid+1 AS Nid FROM noticias ORDER BY Nid DESC LIMIT 1"; $stmt = $DB->prepare($sql); $stmt->bindValue(":Nid", intval($_GET["Nid"])); $stmt->execute(); $results...
asked by 26.10.2015 / 17:21
2
answers

What is the difference of bindValue for an array executed directly in $ pdo-execute ()

I currently use a schedule like this <?php $array = array('nome'=>'Alisson', 'idade'=>20); $query = $conn->prepare("INSERT INTO table (nome,idade) VALUES (:nome, :idade)"); $query->execute($array); ?> What's the differe...
asked by 18.12.2015 / 02:52
1
answer

How to delete multiple clients per checkbox?

I'd like to know what I can do to delete more than one client as selected by checkbox . I have inside a complete form: <form method="post" action="../sys/del.php"> <?php require "../...
asked by 22.12.2015 / 22:04
1
answer

Validate Google Site Verification URLs with Regex

With $ _SERVER ['REQUEST_URI'] I have captured the following address below! /google9f7804416f93fdd6b.html I need to perform a validation with ER, the function must recognize the word Google parâmetros randômicos 9f7804416f93fd...
asked by 30.08.2015 / 02:18
1
answer

Array returns only item 0 PHP

I have the code below in the PHP class. However, the Array is only returning a value (position [0]) in the table. By executing the SQL statement in MySql, two lines return. Could someone tell you where the error is? Thankful. if($consUsu-&g...
asked by 08.09.2015 / 19:18
1
answer

Error connecting database with PDO

I have an OOP code in PHP, when I try to connect to the DB, the following error appears:    Notice: Undefined variable: operator in C: \ xampp \ htdocs \ StudentCount \ app.ado \ TCriteria.class.php on line 16       Notice: Undefined variabl...
asked by 05.09.2015 / 18:16
2
answers

Retrieve text from li and pass to PHP

I'm starting in web development, I have the logic of how to do things, but the problem is implementation. I have a "UL" being populated by database, I would like to know how I capture the selected value of the "LI", set to a variable and that va...
asked by 05.07.2017 / 17:32
2
answers

how do I remove some numbers after the comma in PHP

How do I remove some numbers after the comma in PHP? ex: 25.52382832732732 ...  so I want it to stay only 25.52     
asked by 01.07.2017 / 23:25
1
answer

Eval () PHP, usability and context

I was reading some codes of e-commerce extensions. Usually these modules are paid, but what I was seeing had a 'trial' to try out. I installed and went to analyze the code. I was hoping for something in PHP itself, but it looks like the creators...
asked by 02.05.2016 / 16:17
1
answer

How to Order Related Model Data?

I have the following relationship in my application: Template Customer : class Cliente extends Model { protected $table = 'clientes'; public function Usuario(){ return $this->hasMany('App\Models\Admin\Usuario', 'id_cli...
asked by 18.04.2016 / 15:54