Jump to content

Search the Community

Showing results for tags 'bind_param'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. updating column with increment in mysql

    In phpmyadmin I did the following query and had it output in php like this: $sql = "UPDATE `table` SET count = count + 1 WHERE unique_nr = 5175781"; this all worked well. though when I tried to implement it in my script I had an error: script: <?php // code to establish dbase connection: var_dump($unique_nr); // $stmt = $conn->prepare('UPDATE table SET count = ? WHERE unique_nr = ? '); $stmt = $conn->prepare('UPDATE table SET count = count + 1 WHERE unique_nr = ? '); $stmt->bind_param("is", $count, $unique_nr); $stmt->execute(); ?> resulting in an error message. I also tried this way of writing for bind_param: $stmt->bind_param("s", $unique_nr); but that didnt update the column, though there wasnt an error message anymore
  2. call to a member function; how to solve?

    Hi people I have a table created like this: -- -- Database: `mydatabase` -- -- -------------------------------------------------------- -- -- Tablestructure for table `table_name` -- CREATE TABLE `table_name` ( `num` int(4) NOT NULL, `fol_num` int(7) DEFAULT NULL, `col3` varchar(30) DEFAULT NULL, `col4` int(1) DEFAULT NULL, `num_nonce` varchar(20) DEFAULT NULL, `col6` varchar(30) DEFAULT NULL, `col7` varchar(15) DEFAULT NULL, `col8` varchar(15) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- I also created a function and the goal of the function is to read the random number from fol_num with a mysql query with WHERE. fol_num should match with the number found and show num_nonce belonging to that record. query: SELECT num_nonce, FROM table_name WHERE fol_num = ? ; function: <?php function my_func() { // global global $fol_num; global $num_nonce; $servername = "localhost"; $username = "myname"; $password = "mypassword"; $dbname = "mydatabase"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } var_dump($fol_num); // select nonce from database table $stmt = $conn->prepare("SELECT num_nonce, FROM table_name WHERE fol_num = ? ;" ) ; $stmt->bind_param('is', $fol_num, $num_nonce); $stmt->execute(); $stmt->bind_result($fol_num, $num_nonce); $stmt->fetch(); var_dump($num_nonce); // var_dump($fol_num2); //$stmt->close(); $conn->close(); } my_func(); ?> I receive errors that sound like: Fatal error: Uncaught Error: Call to a member function bind_param() on boolean in ...... pointing to this line: $stmt->bind_param('is', $fol_num, $num_nonce); what is not good and how to solve it?
×