DwZone Forum DwZone Forum
Welcome to the DwZone-it Forum
 
  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  
    RegisterRegister -->   LoginLogin  
Asp Upload and Resize  
DwZone Forum Index -> Asp Upload and Resize

Moderators: AdministratorsModerators 
Hint: For improved responsiveness, use Internet Explorer 4 (or above) with Javascript enabled, choose 'Dynamic' from the View dropdown and hit 'Set Options' to save your changes.
New Topic Search for
 View     Per page     Messages Since 
Messages 161 to 170 of 860 (Total: 366) First |  Prev |  Next |  Last  
 Subject Author Date  
   Re: Update Record Upload Error: "String or binary data would be truncated."  
View this persons public profile  Steve Skinner   15:50 20 Mar 2013  
   Out of string space error  
View this persons public profile  Steve Skinner   10:03 1 May 2012  
   Re: Out of string space error  
View this persons public profile  Gianluigi   10:13 1 May 2012  
   Re: Out of string space error  
View this persons public profile  Steve Skinner   10:21 1 May 2012  
   Re: Out of string space error  
View this persons public profile  Gianluigi   10:34 1 May 2012  
   ASP MYSQL 2004 MX  
View this persons public profile  GlenWhiting   5:43 2 Feb 2012  
   Re: ASP MYSQL 2004 MX  
View this persons public profile  Gianluigi   10:23 2 Feb 2012  
   Insert and Upload creating blank record in database  
View this persons public profile  PierreLetourneau   7:37 26 Jan 2012  
    Foreign Key -Insert picture name in database  
View this persons public profile  JocelynFilion   17:53 28 Aug 2011  
 
Hello,

I'm having trouble to insert the name of the picture in the database. I don't have any trouble if I don't use hidden field like user_id which in the member id from another table

I did a recordset (Membre) to access the page via URL id like add.php?id=3

Trying to see what is going wrong since 6 hours lolll

This is the code.
<?php
//**********************
// DwZone Upload Resize
//**********************
require_once("dwzUpload/dwzUpload.php");
require_once('Connections/connexion.php');
?>

<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$colname_Membre = "-1";
if (isset($_GET['id'])) {
$colname_Membre = $_GET['id'];
}
mysql_select_db($database_connexion, $connexion);
$query_Membre = sprintf("SELECT * FROM membre WHERE id = %s", GetSQLValueString($colname_Membre, "int"));
$Membre = mysql_query($query_Membre, $connexion) or die(mysql_error());
$row_Membre = mysql_fetch_assoc($Membre);
$totalRows_Membre = mysql_num_rows($Membre);
?>
<?php
//**************************
// INSERT RECORD UPLOAD
// http://www.DwZone-it.com
// Version: 1.1.4
//**************************
set_time_limit(5400);
$upload = new dwzUpload();
$upload->SetProgressBar("");
$upload->SetTempFolder("undefined");
$upload->SetTotalFileSize("");
$upload->SetRedirectUrl("ok.php");
$upload->SetFiles("/membre/;1;;.jpg,.jepg,.gif,.png;2048;1;photo1;3;photo1&S;;;0;;;;;1;;1;photo1@_@_@0@_@_@php@_@_@-1;;;80;0;100;125;80;0;_small;0;1;0;;;80;0;_small;0@_@_@./@_@_@POST");
$upload->SetFormName("form1");
$upload->SetUploadType("insert");
$upload->SetValueToRedirectSend("description|titre|user_id");
$upload->SetDbParam($hostname_connexion, $database_connexion, $username_connexion, $password_connexion);
$upload->SetEditTable("annonce_particulier");
$upload->SetFields("titre|value|description|value|annonce_id|value|user_id|value");
$upload->SetColumns("titre|text|description|text|annonce_id|int|user_id|int");
$upload->Execute();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


<?php
//**********************
// DwZone Upload Resize
//**********************
require_once("dwzUpload/dwzUploadClient.php");
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>testing</title>
<style type="text/css">
body,td,th {
font-family: Verdana, Geneva, sans-serif;
font-size: 12px;
color: #333;
}
</style>
</head>

<body><div align="center"><br />
<?php echo $row_Membre['prenom']; ?><br />
2

<form enctype="multipart/form-data" onsubmit="return ProgressBar()" id="form1" name="form1" method="post" action="<?php echo $upload->GetEditAction(); ?>">
<table width="630" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>titre</td>
<td><input type="text" name="titre" id="titre" /></td>
</tr>
<tr>
<td>des</td>
<td><textarea name="description" id="description" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td>photos</td>
<td><input name="photo1" type="file" id="photo1" onchange="dwz_setEvent(this,'change')" onclick="dwz_setEvent(this,'click')" /></td>
</tr>
<tr>
<td><input type="hidden" name="annonce_id" id="hiddenField"><input type="hidden" name="user_id" id="hiddenField"></td>
<td><input type="submit" name="dwzSubmit" id="dwzSubmit" value="Submit" /></td>
</tr>
</table>
<input type="hidden" name="dwzUpload" id="dwzUpload" value="form1" />
</form>
<p> </p>
</div>
</body>
</html>
<?php
mysql_free_result($Membre);
?>

 
Reply to this current thread  View this persons public profile  Send Private Message
   Re: Foreign Key -Insert picture name in database  
View this persons public profile  Gianluigi   9:12 29 Aug 2011  
Last Visit: Saturday 2 Nov, 2024 1:29 am First |  Prev |  Next |  Last  
 Login
Username:  Password:    
Read Message Read Message   Unread message Unread message
Read message [popular] Read message [popular]   Unread message [popular] Unread message [popular]
Read message [locked] Read message [locked]   Unread message [locked] Unread message [locked]
All times are GMT-1

Jump to: