Значит есть ошибки.
--
-- Структура таблицы `L007_demo`
--
CREATE TABLE `L007_demo` (
`id` int(11) NOT NULL,
`age` varchar(32) NOT NULL,
`sex` varchar(32) NOT NULL,
`stores` varchar(32) NOT NULL,
`costs` smallint(5) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Индексы таблицы `L007_demo`
--
ALTER TABLE `L007_demo`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT для сохранённых таблиц
--
--
-- AUTO_INCREMENT для таблицы `L007_demo`
--
ALTER TABLE `L007_demo`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
<?
$mysqli = mysqli_connect('localhost', 'root', '', 'test');
$stmt = mysqli_prepare($mysqli, "INSERT INTO L007_demo (age, sex, stores, costs) VALUES (?, ?, ?, ?)");
if($stmt) {
$age = '25-35'; $sex = 'female'; $stores = '2 stor'; $costs = 800;
mysqli_stmt_bind_param($stmt, 'sssd', $age, $sex, $stores, $costs);
mysqli_stmt_execute($stmt);
echo mysqli_stmt_affected_rows($stmt) . '<br><pre>';
$q = mysqli_query($mysqli, 'SELECT * FROM L007_demo');
print_r(mysqli_fetch_assoc($q));
} else exit('error: ' . mysqli_error ($mysqli));
?>
Результат
1
Array
(
[id] => 1
[age] => 25-35
[sex] => female
[stores] => 2 stor
[costs] => 800
)