Iosub Iosub - 1 year ago 53
SQL Question

Innodb insert issue

I am working on a project wich uses Innodb as storage engine, and mysqli connection. I don't know how to use it. I've found some tutorials, made some query, but for example, I don't see with phpmyadmin, the values inserted via a query made on the page. Even if on the page, results appear.

The project was made by someone else. I must add some improvements. I'm tired of working on this :( Please help

There is no errpr message. Simply the query works, as I see on the page the results. But I don't see them in the database. So, where does it takes the data?

$select = "select gal_post_status, gal_pic_name, gal_defaultimage
from pf_gallery
where gal_userid = $userid
order by gal_defaultimage desc";
$stmt = $dbc->prepare($select);

$stmt->bind_result($_status, $_in_picture, $_default);

On the main page I see the results but I can't find them into the db.

Answer Source

You can improve this question more. I don't think sql insertion syntax does change for innodb or myisam.. whatever. As for php myadmin read its tutorial, (i don't work on it) but I gues you have to ask from it to show the results, with a select * from table or visualy by your mouse.

No matter what tutorial you see, you must first get the schema in you hands and see the dependencies (foreign keys). This means insertion must respect that schema. For example if a have a table for customers and a table for its phones with a foreign key depended on customer then innodb will not let you insert a phone if the customer does not exists already. So you must first enter the customer and then the phone number like this (supposing customer has an autoincrement id):

insert into `Customer` ( `name`,`surname`) values ('Jimm`, `White');
insert into `Phone` (`cust_id`, `phone`) values ((SELECT LAST_INSERT_ID()), 2332423);

I'm tired of working on this

I wish I had a project to work on and being paid! You have to reconsider how you see it, seeing it as boring will take you more time to be done.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download