php

php – Is it possible to keep the formatting of the text of a textarea when inserting it into MySQL and retrieving it?

Question: I am making a website that has a news section. The page will have an administrative sector in which people (with almost no knowledge of computers) will write news. The idea is that the news is formatted (by format I mean line breaks). How can I do that? Basically …

php – Is it possible to keep the formatting of the text of a textarea when inserting it into MySQL and retrieving it? Read More »

php – SSL error when posting new post

Question: I ran into an error today when using Zend to post to my blogger blog. Using PHP this is the code: <?php set_time_limit(0); date_default_timezone_set(‘America/Argentina/Buenos_Aires’); if (isset($_POST[‘submit’])) { // load Zend Gdata libraries require_once ‘Zend/Loader.php’; Zend_Loader::loadClass(‘Zend_Gdata’); Zend_Loader::loadClass(‘Zend_Gdata_Query’); Zend_Loader::loadClass(‘Zend_Gdata_ClientLogin’); Zend_Loader::loadClass(‘Zend_Gdata_Feed’); // set credentials for ClientLogin authentication $user = “xxxxxx@gmail.com”; $pass = …

php – SSL error when posting new post Read More »

php – $pdo->lastInsertId(); Is it possible that the value is incorrect?

Question: Let's say we have this code: $stmt = $pdo -> prepare(“INSERT INTO users (email,password) VALUES (:email,:password)”); $stmt->bindParam(‘:email’, $email); $stmt->bindParam(‘:password’, $password); $stmt->execute(); $_SESSION[‘id’] = $pdo->lastInsertId(); If I were to call the lastInsertId() method on $stmt , I wouldn't ask myself the following question: lastInsertId() takes the value of the last …

php – $pdo->lastInsertId(); Is it possible that the value is incorrect? Read More »

Scroll to Top