mysqli

Insert values from checkboxes in various tables?

Hi, i have this form: wich contains a list of students on the left and a lot of skills to assign to each student. Each student have it´s own table with the full skill list (HTML, CSS, ...). Now whats a simple way to get value from the checkboxes and assign them to the corresponding student table? The purpose is to creating a graph f...

mysqli,php store procedure not executing : getting Error

$link = mysqli_connect("localhost", "username", "testpassword", "dbname")or die('connection problem'); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } //if ($result = mysqli_query($link, "CALL my_sqrt(Other,@out_value)")) { $result =...

php mysqli stmt

i'm new to the php mysql usage. i'm selecting the results from database .. and i'm cycling/printing them out to the screen using while($stmt->fetch()): .. what i'd like to do is to cycle through the results again after the first cycle without calling the database (frombuffered results set). i'm using php5, mysqli, stms on xampp serv...

On one page works on another throws: Call to a member function fetch_assoc() on a non-object

Hi, I've been through all the answers for this error, but something weird happens in my case. I have: $result = $mysqli->query("SELECT * FROM table"); while ($row = $result->fetch_assoc()) { // data echoed here } I have 3 different behaviors of this: 1.On one page this works perfectly 2.On another page it throws the: Call to a m...

Php Mysqli Persistent connection error

I have a problem in my script that appen sometimes,usually when i leave it for some time(like 5-10 minutes)without requests i get this error: Warning: mysqli_connect() [function.mysqli-connect]: MySQL server has gone away in FILE.php on line 30 and this is the code that gives me error is this: $this->db=mysqli_connect('p:'.$this-...

PHP bind_param alternative for ODBC?

Greetings, I am developing an Admin Control panel and I have to use ODBC to connect to the Database. I'm used to using MySQLi so this is extremely awkward for me. I'm trying to make this as OOP as possible, so I'm using classes and prepared statements. I need to know if there is an ODBC alternative to bind_param and how to use it? I'm...

PHP MySQLi insert ids from multi_query()

Is there a way to get the last generated auto_increment IDs after inserting several rows with mysqli multi_query function? EDIT: I managed to get it work by adding SELECT LAST_INSERT_ID(); after each INSERT query in the multi query and then use the mysqli_use_result to get all ids, and I think this is the best way. ...

MySQL query to check for certain phrases (duplicate article, plagiarism)

Is there a way to check for multiple phrases in mysql? I need to check if an article have a duplicate version stored in mysql. This is the algorithm I first create an array of sentences that needed to be check (removing all non-alpha-numeric characters) Then Build the query (how?) After I get the result I compare if 50% of the sentenc...

MySQL Fulltext search phrases

How to use mysql fulltext search to search for phrases instead of like : SELECT description FROM t WHERE info LIKE "%Search phrase one%" OR info LIKE "%Phrase second%" OR info LIKE "%Another phrase with more words%" ...

Split strings in mysql

Hi All, I want to create a stored procedure which will do matching of two tables. My requirement is to match two tables based on the columns user passes as an input. Syntax: CREATE PROCEDURE reconcile.matchTables(IN TAB1 VARCHAR(25), IN TAB1 VARCHAR(25), IN COLS1 VARCHAR(250) , IN COLS2 VARCHAR(250)) EX: matchTables('table1', 'table2...

Python - About the results retrieved from mysqli

>>> c = conn.cursor() >>> c.execute('select * from stocks order by price') >>> for row in c: ... print row ... (u'2006-01-05', u'BUY', u'RHAT', 100, 35.14) (u'2006-03-28', u'BUY', u'IBM', 1000, 45.0) As what we can see, there's an 'u' in front of each column. And it's getting worse in my db. How could we print the normal string?...

mysqli bind_result & fetch returns fewer columns

Hello, everybody! I have the following code: <?php $mysqli = new MySQLi($db_host, $db_user, $db_pass, $db_select); $stmt = $mysqli->prepare("SELECT new_title, new_subtitle, new_description FROM news WHERE new_id = ?"); $stmt->bind_param("i", $selected_id); $stmt->execute(); $stmt->bind_result($news_title, $news_subt...

PHP 5.3: mysqli_multi_query and "commands out of sync" errors

When I use mysqli_multi_query() with a mass INSERT query, then after the query has run do another query using mysqli_query('SELECT...'), I get "commands out of sync" errors. Does anyone know why this happens? ...

MySQL Conditional Replication based on Records

Hey there, Our organization has a very large database which Replicates to separate global servers. In our database some tables contain data exclusive to a certain region thus providing privileges to exclusive information to users who are within those regions. example ( transactions_australia, transactions_dubai ) Contrary t...

MySQL - MySQLi and the story of a mysterious error.

Hello, I have a system that runs on hundreds of websites and I am getting an error for the first time. I was hoping that someone could tell me what may cause this error so I can try to remove it. The issue comes when trying to add a page. INSERT INTO pages (parent, name, type, sort) VALUES ('0', 'test', 'text', '37.5'); This spits o...

mysql_connect not working

Hi mysql_connect is not working but mysql_iconnect is working. Please help. Thanks ...

Using mysql_* functions with a mysqli connection

I was wondering if the older mysql_* functions provided with php will work with a mysqli connection. ...

PHP+Ajax : Add-a-friend system

I'm trying to make a little project for adding friends. When you click the add friend button you are sending an Ajax call with the friend id & username (they are the id and name attributes of each add button) to the add.php file. (The mysql structure is: 1 users table + X tables named the user's name(columns: friendid, ispending)) In the...

mysqli php extend

Hi guys, i was wondering if you could point me in the right direction. Im extending the mysqli class but cant seem to call the error function.. <?php class mysqli_ls extends mysqli { private $activeConnection = 0; private $linkArr = array(); private $queryArr = array(); private $errorArr = array(); public function _...

php login: issue with header

I'm trying to make a login page using php, but when I use header() to redirect to another page, my user/pass check on my database somehow fails. Am I doing something wrong? Also, I know I'm missing security guards, I'm implementing in steps since I'm still rather new to PHP. But some tips and suggestions would be appreciated! $dbc = my...