IM子查詢,但我不使用活動記錄,有問題即時執行這個查詢,它給了我一個錯誤編號1064MySQL查詢,使用笨作爲我的框架,笨
essentialy,即時通訊試圖插入一堆數據的一個表,而是從其他表
$titulo = $datos['titulo'];
$tipo = $datos['tipo'];
$autor = $datos['autor'];
$autor2 = $datos['autor2'];
$editorial = $datos['editorial'];
$ano = $datos['ano'];
$paginas = $datos['paginas'];
$descripcion = $datos['descripcion'];
$image_path = 'hola';
$genero = $datos['genero'];
$genero2 = $datos['genero2'];
$sql = "INSERT INTO productos (titulo, autor_id, autor2_id, editorial_id, ano, paginas, genero_id,
genero2_id, tipo, descripcion, image_path)
SELECT ? AS titulo,
id FROM autores WHERE nombre_autor=?,
id FROM autores WHERE nombre_autor=?,
id FROM editoriales WHERE nombre_editorial=?,
? as ano,
? as paginas,
id FROM generos WHERE nombre_genero=?,
id FROM generos WHERE nombre_genero=?,
? as tipo,
? as descripcion,
? as image_path";
if($this->db->query($sql, array($titulo, $autor, $autor2, $editorial, $ano, $paginas, $genero, $genero2, $tipo, $descripcion, $image_path))){
return true;
}else{
return false;
}
有人可以幫我這個查詢查詢一些身份證號碼?
謝謝...
謝謝,讓我看看 – kastulo 2013-03-12 21:50:07
你有沒有這個運氣? – 2013-03-13 14:16:48