Search the Community
Showing results for tags 'type'.
-
Hello - first time posting. I've searched the forums to see if anyone else had the same question, with no luck. I'm going through the lessons in the tutorial but I can't figure out what's going on in part of the JS Type Conversion lesson. I'll link to the full lesson here, but below is the part I'm having trouble with: (mainly the function) I have no idea what's happening in the function... could someone be kind enough to break it down in detail for me? I understand how arrays work. But the function here has me stumped. Thanks so much
- 1 reply
-
- type
- conversion
-
(and 6 more)
Tagged with:
-
Hi guys, I have a odd problem here. I'm a beginner and I have no idea what it can be.. 😑 ps. English is not my first language, so I hope you can understand... ☺️ In dropdown field below, I put in value property the ID column, but when it registers in the database, it saves as string type and not as integer. <?php $sql = "SELECT id, sigla FROM local ORDER BY sigla ASC"; $result = $conn->query($sql); ?> . . . <select name="local" class="form-control"> <option selected>Selecione...</option> <?php while($row = $result->fetch_assoc()){ echo "<option value=".$row['id'].">".$row['sigla']."</option>"; } ?> </select> . . . I used a var_dump() on ID to know what would happend, and it shows as string type. <pre> <?php $sql = "SELECT id, sigla FROM local ORDER BY sigla ASC"; $result = $conn->query($sql); $row = $result->fetch_assoc(); var_dump($row['id']); ?> </pre> Result: string(1) "5" This is the database: -- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Banco de dados: `arq` -- -- -------------------------------------------------------- -- -- Estrutura para tabela `local` -- CREATE TABLE `local` ( `id` int(11) NOT NULL, `SIGLA` mediumtext NOT NULL, `LOCAL` mediumtext NOT NULL, `TELEFONE` mediumtext NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Fazendo dump de dados para tabela `local` -- INSERT INTO `local` (`id`, `SIGLA`, `LOCAL`, `TELEFONE`) VALUES (1, 'AAC', 'AAC', '2222-2222'), (2, 'DSV', 'DSV', '1111-1111'), (3, 'SCA', 'SCA', '3333-3333'); -- -- Índices de tabelas apagadas -- -- -- Índices de tabela `local` -- ALTER TABLE `local` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT de tabelas apagadas -- -- -- AUTO_INCREMENT de tabela `local` -- ALTER TABLE `local` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; Thank you so much!!
-
ok im having this issue with the format that is in an array() when comparing it to the $_FILES type $allowed = array('png', 'jpg', 'jpeg', 'gif');if($ptype != $allowed){ $errors[] = 'This format isnt allow</br>Accepted formats are as followed: PNG, JPG, JPEG, GIF';} when i try to upload a .tiff, .doc, .txt file it still upload but once i upload the correct file it displays the error message any tips, hint, advice on how i can go about fixing this?
-
Hi, I was looking for a topic related to customizing an input type="date" to only select days from weeks, but I could not find something related to it. Could you please help me with this one ? Thanks. PD: I did this with JS, but I don't know if it is possible to set it directly in the input tag.