Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Array callback has to contain indices 0 and 1

Tags:

php

mysql

I am getting this error:

Fatal error: Array callback has to contain indices 0 and 1 in C:\xampp\htdocs\phpprojects\plapp\worker.php on line 53

How can I solve that problem? What's wrong with what I am doing here?

$results = mysql_query("SELECT asin_link FROM work WHERE email=$w_email");
      while($row = mysql_fetch_array($result)) {
      $work_link = $row['asin_link'];
      echo '<a href="'.$work_link.'" target="'.$work_link.'">Visit Work link<br></a>';
      echo '<form action="" method="post">
        ASIN Number: <input type="text" name="asin"><br>
        <input type="submit" value="Submit" name="submit">
      </form>';}
      if (isset($_POST['submit'])) {
        $asin = $_POST('asin');
        $qu ="INSERT INTO work (asin, email, asin_link) VALUES ('$asin', '$w_email','$work_link')";
        if (mysql_query($qu)) {
        echo "Your ASIN was received! Thanks";
      }
      }
like image 549
Khazz T. Avatar asked May 22 '16 04:05

Khazz T.


1 Answers

change this

$asin = $_POST('asin');

to

$asin = $_POST['asin'];
like image 110
Waleed Ahmed Avatar answered Sep 18 '22 11:09

Waleed Ahmed