0

Can anybody please point out mistakes I make in this code?

for($i=0; $i<count($fileDirectories); $i++){

            echo 'asdasd';
            echo $fileDirectories[$i];
            $queryFiles = "UPDATE maintable SET Picture$i = '$fileDirectories[$i]' WHERE id = $idNeeded;";
            mysqli_query($link, $queryFiles); 
        }

I just cant find a good duide to that

3
  • 1
    $queryFiles = "UPDATE maintable SET Picture$i = '" . $fileDirectories[$i] . "' WHERE id = '" . $idNeeded ."'"; Commented Feb 28, 2014 at 22:26
  • 1
    Try codereview.stackexchange.com - question as it stands is off-topic here. Commented Feb 28, 2014 at 23:03
  • codereview.stackexchange.com Commented Feb 28, 2014 at 23:03

1 Answer 1

1

$queryFiles = "UPDATE maintable SET Picture$i = '$fileDirectories[$i]' WHERE id = '$idNeeded'";

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks guys, but i found also another mysql mistake and both of your answers seems not to work because of that
just found the source of mistake. thanks i had a correct syntax from you. now everything works!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.