我知道他们的问题是什么,你如何链接它们,或者当你在不同的表中有相同的名字时它们是自动链接的.这是一个例子:
假设我有一个[orders]表和一个[customer]表.[orders]表中的每一行都有一个customer_id号,该号码与[customer]表中的customer_id相关联.那么如何通过参考订单获取客户信息?什么是SQL查询?
我正在尝试从projects表中删除一个项目以及表中与该项目关联的所有图像images。
可以说 p_id = 10
DELETE FROM projects, images WHERE projects.p_id = ? AND images.p_id = ?
Run Code Online (Sandbox Code Playgroud)
这个查询有什么问题?
我试图通过这样做来更新MySQL数据库中一个表中的多个行.它不起作用.
$query = "UPDATE cart SET cart_qty='300' WHERE cart_id = '21';
UPDATE cart SET cart_qty='200' WHERE cart_id = '23';
UPDATE cart SET cart_qty='100' WHERE cart_id = '24';";
mysql_query($query,$link);// $link is specified above
Run Code Online (Sandbox Code Playgroud)
任何人都知道这有什么问题.
嗨,我正在尝试使用PHP脚本上传图像.什么是非常奇怪的是我只在Internet Explorer中得到以下错误,其他地方的脚本工作正常:
Warning: move_uploaded_file(pictures/) [function.move-uploaded-file]: failed to open stream: Is a directory in /home/tntauto1/public_html/admin_add1.php on line 59
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpcJnHZE' to 'pictures/' in /home/tntauto1/public_html/admin_add1.php on line 59
Warning: copy() [function.copy]: The first argument to copy() function cannot be a directory in /home/tntauto1/public_html/admin_add1.php on line 60
Run Code Online (Sandbox Code Playgroud)
这是脚本:
if(is_uploaded_file($_FILES['image']['tmp_name'])){
if($_FILES['image']['type'] == 'image/jpeg'){
$original = 'original_'.$v_id.'.jpg';
$large = 'large_'.$v_id.'.jpg';
$small = 'small_'.$v_id.'.jpg';
}elseif($_FILES['image']['type'] == 'image/gif'){
$original = 'original_'.$v_id.'.gif';
$large = 'large_'.$v_id.'.gif';
$small = 'small_'.$v_id.'.gif';
}else{
$error = 'Error: The …Run Code Online (Sandbox Code Playgroud)