Jump to content

Recommended Posts

Here is my script and Here is the error:

 

Cannot query the database.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET ='http://www.mydomain.com/host', ='/home/mydomain/public_html/ho' at line 1

 

This is part of my functions.php

 

<?php

include '../../inc/sqlinf.php';

 

$a = $_POST['1'];

$b = $_POST['2'];

$c = $_POST['3'];

$d = $_POST['4'];

$e = $_POST['5'];

$f = $_POST['6'];

$g = $_POST['7'];

$h = $_POST['8'];

$i = $_POST['9'];

$j = $_POST['10'];

 

if ($edit == 'tru') {

 

$v ="UPDATE $which SET";

$w =" WHERE ID = '$id'";

 

}else{

$v ="INSERT INTO $which SET";

$w = $nil;

}

 

if (empty($b)) {$bc = $no; } else {$bc=',';}

if (empty($c)) {$cc = $no; } else {$cc=',';}

if (empty($d)) {$dc = $no; } else {$dc=',';}

if (empty($e)) {$ec = $no; } else {$ec=',';}

if (empty($f)) {$fc = $no; } else {$fc=',';}

if (empty($g)) {$gc = $no; } else {$gc=',';}

if (empty($h)) {$hc = $no; } else {$hc=',';}

if (empty($i)) {$ic = $no; } else {$ic=',';}

if (empty($j)) {$jc = $no; } else {$jc=',';}

if (empty($k)) {$kc = $no; } else {$kc=',';}

 

if (empty($a)) {$t1= $nono; $q1 = $abc; $q2 = $def;}else{$q1a="'"; $q2a="=";}

if (empty($b)) {$t2= $nono; $q1 = $abc; $q2 = $def;}else{$q1b="'"; $q2b="=";}

if (empty($c)) {$t3= $nono; $q1 = $abc; $q2 = $def;}else{$q1c="'"; $q2c="=";}

if (empty($d)) {$t4= $nono; $q1 = $abc; $q2 = $def;}else{$q1d="'"; $q2d="=";}

if (empty($e)) {$t5= $nono; $q1 = $abc; $q2 = $def;}else{$q1e="'"; $q2e="=";}

if (empty($f)) {$t6= $nono; $q1 = $abc; $q2 = $def;}else{$q1f="'"; $q2f="=";}

if (empty($g)) {$t7= $nono; $q1 = $abc; $q2 = $def;}else{$q1g="'"; $q2g="=";}

if (empty($h)) {$t8= $nono; $q1 = $abc; $q2 = $def;}else{$q1h="'"; $q2h="=";}

if (empty($i)) {$t9= $nono; $q1 = $abc; $q2 = $def;}else{$q1i="'"; $q2i="=";}

if (empty($j)) {$t10=$nono; $q1 = $abc; $q2 = $def;}else{$q1j="'"; $q2j="=";}

 

$sql = "$v

$t1 $q2a$q1a$a$q1a$bc

$t2 $q2b$q1b$b$q1b$cc

$t3 $q2c$q1c$c$q1c$dc

$t4 $q2d$q1d$d$q1d$ec

$t5 $q2e$q1e$e$q1e$fc

$t6 $q2f$q1f$f$q1f$gc

$t7 $q2g$q1g$g$q1g$hc

$t8 $q2h$q1h$h$q1h$ic

$t9 $q2i$q1i$i$q1i$jc

$t10 $qj$q1j$j$q1j$kc

$w

";

$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());

 

$variable = "../$return.php";

include '../resend.php';

?>

 

Link to comment
https://forums.phpfreaks.com/topic/143229-cannot-query-the-database/
Share on other sites

I'm a bit lost I'm not sure which instructions to follow and the last one about combining them... I'm not sure how to I'm using this script I didn't write it I'm trying to figure out whats wrong with it so I can get it working. I'm not so good at writting code or programming sql/php stuff. I figured it would just work.

I'm a bit lost I'm not sure which instructions to follow and the last one about combining them... I'm not sure how to I'm using this script I didn't write it I'm trying to figure out whats wrong with it so I can get it working. I'm not so good at writting code or programming sql/php stuff. I figured it would just work.

 

Little off topic but, do you mind disclosing where you got this script from?  Did you pay for it?  Did someone write it for you?  Did you steal it?  Why don't you ask them?

that has to be a obfuscate script!

 

lol, yeah obfuscate.php

 

Maybe there's a legit reason for him not knowing how this script works...  Why can't you go back to the author and ask him to fix it?  It's hard for us to help you if you don't know anything about your code...  Plus the format is hard to follow.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.