i kad ubacim neki tekst izadje greska Incorrect integer value: '' for column 'l_id' at row 1
a evo koda ma molim da pomognete,ja nisam upseo da nadjem gresku..
Code:
<?php
require_once("../../class2.php");
require_once(HEADERF);
require_once(e_BASE."/e107_handlers/mail.php");
require_once("pre-defs.php");
if($pref['lyrics_4'] == '1') {anchors();}else{origAnchors();}
$title = _gs01;
$text = "<div style='text-align:center'>";
// show form if enabled
if($pref['lyrics_3'] == 1) {
// ===== insert new record =====
if(IsSet($_POST['addL'])) {
// ===== check to see if artist and album are new or exist =====
$dd_artist = $_POST['dd_artist'];
$dd_album = $_POST['dd_album'];
$a = $_POST['l_artist'];
$b = $_POST['l_album'];
if($dd_artist <> "" && $a <> "") {
$message = _gs02;
$insert_artist = "";
}else{
if($dd_artist <> "") { // use existing artist
$insert_artist = $dd_artist;
// ===== get existing image =====
$get_artist_sql = new db;
$get_artist_sql -> db_Select("w1n_lyrics","l_artist,l_img_artist","WHERE l_artist = '$dd_artist'","nowhere",$debug=FALSE);
while($row = $get_artist_sql -> db_Fetch()){
extract($row);
$my_artist_img = $l_img_artist;
}
}else{
if($a <> ""){ // add new artist
$insert_artist = $a;
$my_artist_img = "images/no_image.jpg";
}
}
}
if($dd_album <> "" && $b <> "") {
$message = _gs03;
$insert_album = "";
}else{
if($dd_album <> "") { // use existing album
$insert_album = $dd_album;
// ===== get existing image
$get_album_sql = new db;
$get_album_sql -> db_Select("w1n_lyrics","l_album,l_img_album","WHERE l_album = \"$dd_album\"","nowhere",$debug=FALSE);
while($row = $get_album_sql -> db_Fetch()) {
extract($row);
$my_album_img = $l_img_album;
}
}else{
if($b <> "") { // add new album
$insert_album = $b;
$my_album_img = "images/no_image.jpg";
}
}
}
// ===== end check =====
if($insert_artist && $insert_album <> "") {
$newSql = new db;
$newSql -> db_Insert("w1n_lyrics","'','$insert_artist',\"$insert_album\",'".$_POST['l_song']."',\"".$_POST['l_lyrics']."\",'".$_POST['l_author']."','1','".$_POST['l_date']."','1','$my_artist_img','$my_album_img','0','0','0',''","nowhere")or die(mysql_error());
// send email if submit
if($pref['lyrics_6'] == 0) {
$send_to = $pref['lyrics_5'];
$subject = _gs04;
$message = _gs05."\n \n";
$message .= _gs06." $insert_artist \n";
$message .= _gs07." $insert_album \n";
$message .= _gs08.$_POST['l_song'] ."\n";
$message .= $_POST['l_lyrics'] ."\n";
if (mail($send_to, $subject, $message)) {
#if(sendemail($send_to, $subject, $message,$to_name,$send_from,$from_name,$attachments,$Cc,$Bcc,$returnpath,$returnreceipt)) {
echo "mail successfully sent";
}else{
echo "mail failed";
}
}
// ===== generate proper message =====
header("location: guest_submit.php?message="._gs09);
// ===== end message =====
}else{
$message = _gs10;
} // end if values exist for insert_artist and insert_album
} // end if upload button clicked
if($message) { $ns -> tablerender("", "<div style='text-align:center'><b>$message</b></div>"); }
if($_REQUEST['message']) { $ns -> tablerender("", "<div style='text-align:center'><b>".$_REQUEST['message']."</b></div>"); }
$text .= "<form method='post' action='".e_SELF."'><fieldset><table style='width:90%' class='fborder'>
<tr><th class='forumheader' colspan='2'>$title</th></tr>
<tr><td class='forumheader3'>"._gs06."</td><td class='forumheader3'><select name='dd_artist'><option value=''> "._gs11." </option>";
// ===== drop down for existing artist
$ea = new db();
if($ea -> db_Select("w1n_lyrics","DISTINCT l_artist","WHERE l_check_submit = '0' ORDER BY l_artist","nowhere")) {
while($row = $ea -> db_Fetch()){
extract($row);
$text .= "<option value=\"$l_artist\">$l_artist</option>";
}
}else{
$text .= "<option value=''> "._gs12." </option>";
}
$text .= "</select> <input name='l_artist' class='tbox' /></td></tr>
<tr><td class='forumheader3'>"._gs07."</td><td class='forumheader3'><select name='dd_album'><option value=''> "._gs13." </option>";
// ===== drop down for existing album
$ea2 = new db();
if($ea2 -> db_Select("w1n_lyrics","DISTINCT l_album","WHERE l_check_submit = '0' ORDER BY l_album","nowhere")) {
while($row = $ea2 -> db_Fetch()){
extract($row);
$text .= "<option value=\"$l_album\">$l_album</option>";
}
}else{
$text .= "<option value=''> "._gs14." </option>";
}
$text .= "</select> <input name='l_album' class='tbox' /></td></tr>
<tr><td class='forumheader3'>"._gs08."</td><td class='forumheader3'><input name='l_song' class='tbox' size='50' /></td></tr>
<tr><td class='forumheader3'>"._gs15."</td><td class='forumheader3'><textarea name='l_lyrics' cols='45' rows='10'></textarea></td></tr>
<tr><td class='forumheader3'>"._gs16."</td><td class='forumheader3'><input name='l_author' class='tbox' size='50' /></td></tr>
<tr><td colspan='2' style='text-align:center' class='forumheader3'><input name='addL' type='submit' value='"._gs17."' /> <input name='reset' type='reset' value='"._gs19."' /><input name='l_date' type='hidden' value='".date('Y-m-d')."' /></td></tr>
$main_link";
$text .= "</table></fieldset></form>";
}else{
$text .= "<div style='text-align:center'><b>"._gs18."</b></div>";
}
$text .= "</div>";
$ns -> tablerender($title, $text);
require_once(FOOTERF);
?>
<?php
require_once("../../class2.php");
require_once(HEADERF);
require_once(e_BASE."/e107_handlers/mail.php");
require_once("pre-defs.php");
if($pref['lyrics_4'] == '1') {anchors();}else{origAnchors();}
$title = _gs01;
$text = "<div style='text-align:center'>";
// show form if enabled
if($pref['lyrics_3'] == 1) {
// ===== insert new record =====
if(IsSet($_POST['addL'])) {
// ===== check to see if artist and album are new or exist =====
$dd_artist = $_POST['dd_artist'];
$dd_album = $_POST['dd_album'];
$a = $_POST['l_artist'];
$b = $_POST['l_album'];
if($dd_artist <> "" && $a <> "") {
$message = _gs02;
$insert_artist = "";
}else{
if($dd_artist <> "") { // use existing artist
$insert_artist = $dd_artist;
// ===== get existing image =====
$get_artist_sql = new db;
$get_artist_sql -> db_Select("w1n_lyrics","l_artist,l_img_artist","WHERE l_artist = '$dd_artist'","nowhere",$debug=FALSE);
while($row = $get_artist_sql -> db_Fetch()){
extract($row);
$my_artist_img = $l_img_artist;
}
}else{
if($a <> ""){ // add new artist
$insert_artist = $a;
$my_artist_img = "images/no_image.jpg";
}
}
}
if($dd_album <> "" && $b <> "") {
$message = _gs03;
$insert_album = "";
}else{
if($dd_album <> "") { // use existing album
$insert_album = $dd_album;
// ===== get existing image
$get_album_sql = new db;
$get_album_sql -> db_Select("w1n_lyrics","l_album,l_img_album","WHERE l_album = \"$dd_album\"","nowhere",$debug=FALSE);
while($row = $get_album_sql -> db_Fetch()) {
extract($row);
$my_album_img = $l_img_album;
}
}else{
if($b <> "") { // add new album
$insert_album = $b;
$my_album_img = "images/no_image.jpg";
}
}
}
// ===== end check =====
if($insert_artist && $insert_album <> "") {
$newSql = new db;
$newSql -> db_Insert("w1n_lyrics","'','$insert_artist',\"$insert_album\",'".$_POST['l_song']."',\"".$_POST['l_lyrics']."\",'".$_POST['l_author']."','1','".$_POST['l_date']."','1','$my_artist_img','$my_album_img','0','0','0',''","nowhere")or die(mysql_error());
// send email if submit
if($pref['lyrics_6'] == 0) {
$send_to = $pref['lyrics_5'];
$subject = _gs04;
$message = _gs05."\n \n";
$message .= _gs06." $insert_artist \n";
$message .= _gs07." $insert_album \n";
$message .= _gs08.$_POST['l_song'] ."\n";
$message .= $_POST['l_lyrics'] ."\n";
if (mail($send_to, $subject, $message)) {
#if(sendemail($send_to, $subject, $message,$to_name,$send_from,$from_name,$attachments,$Cc,$Bcc,$returnpath,$returnreceipt)) {
echo "mail successfully sent";
}else{
echo "mail failed";
}
}
// ===== generate proper message =====
header("location: guest_submit.php?message="._gs09);
// ===== end message =====
}else{
$message = _gs10;
} // end if values exist for insert_artist and insert_album
} // end if upload button clicked
if($message) { $ns -> tablerender("", "<div style='text-align:center'><b>$message</b></div>"); }
if($_REQUEST['message']) { $ns -> tablerender("", "<div style='text-align:center'><b>".$_REQUEST['message']."</b></div>"); }
$text .= "<form method='post' action='".e_SELF."'><fieldset><table style='width:90%' class='fborder'>
<tr><th class='forumheader' colspan='2'>$title</th></tr>
<tr><td class='forumheader3'>"._gs06."</td><td class='forumheader3'><select name='dd_artist'><option value=''> "._gs11." </option>";
// ===== drop down for existing artist
$ea = new db();
if($ea -> db_Select("w1n_lyrics","DISTINCT l_artist","WHERE l_check_submit = '0' ORDER BY l_artist","nowhere")) {
while($row = $ea -> db_Fetch()){
extract($row);
$text .= "<option value=\"$l_artist\">$l_artist</option>";
}
}else{
$text .= "<option value=''> "._gs12." </option>";
}
$text .= "</select> <input name='l_artist' class='tbox' /></td></tr>
<tr><td class='forumheader3'>"._gs07."</td><td class='forumheader3'><select name='dd_album'><option value=''> "._gs13." </option>";
// ===== drop down for existing album
$ea2 = new db();
if($ea2 -> db_Select("w1n_lyrics","DISTINCT l_album","WHERE l_check_submit = '0' ORDER BY l_album","nowhere")) {
while($row = $ea2 -> db_Fetch()){
extract($row);
$text .= "<option value=\"$l_album\">$l_album</option>";
}
}else{
$text .= "<option value=''> "._gs14." </option>";
}
$text .= "</select> <input name='l_album' class='tbox' /></td></tr>
<tr><td class='forumheader3'>"._gs08."</td><td class='forumheader3'><input name='l_song' class='tbox' size='50' /></td></tr>
<tr><td class='forumheader3'>"._gs15."</td><td class='forumheader3'><textarea name='l_lyrics' cols='45' rows='10'></textarea></td></tr>
<tr><td class='forumheader3'>"._gs16."</td><td class='forumheader3'><input name='l_author' class='tbox' size='50' /></td></tr>
<tr><td colspan='2' style='text-align:center' class='forumheader3'><input name='addL' type='submit' value='"._gs17."' /> <input name='reset' type='reset' value='"._gs19."' /><input name='l_date' type='hidden' value='".date('Y-m-d')."' /></td></tr>
$main_link";
$text .= "</table></fieldset></form>";
}else{
$text .= "<div style='text-align:center'><b>"._gs18."</b></div>";
}
$text .= "</div>";
$ns -> tablerender($title, $text);
require_once(FOOTERF);
?>
Bio bi onom ko pomogne zahvalan do neba...