我无法使INSERT工作 [英] I Can´t get INSERT to work

查看:34
本文介绍了我无法使INSERT工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在用这种方法把头撞到墙上:

I have been banging my head to the wall with this:

  1. 将POST值保存到数组中.
  2. 选择外键.
  3. 其他一些INSERT操作


$insertdates = "INSERT INTO dates (asid,acq_date, serv_guaranteedate
               , maintenance_period, expiration_date) 
               VALUES ('$foreignkey','$uservalues[1]'
               ,'$uservalues[4]','$uservalues[5]','$uservalues[3]')";
$upsdasult= mysql_query($insertdates);

在插入和$ foreignkey采用正确格式之前,所有值均采用正确格式. (我已经在insert语句之前回显了值).
该操作成功运行,但是当我查看数据库时,什么都没有插入.

All the values are in the correct format before the insert and $foreignkey is in correct format. (I have echoed the values before the insert statement).
The operation runs succesfully, but when I look at the database, nothing has been inserted.

有人可以告诉我我做错了吗?

Could Somebody please tell me what I´m doing wrong?

推荐答案

您必须使用花括号来嵌入数组变量:

You have to use curly braces to embed a array variable:

echo "This is an {$array['value']}";

这篇关于我无法使INSERT工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆