Note that there are some explanatory texts on larger screens.

plurals
  1. POPhp error Notice: Undefined index: UserID in C:\wamp\www\tweetball\classes\word.class.php on line 35
    primarykey
    data
    text
    <p>I keep getting this error. And I don't know why... Thanks</p> <p>Notice: Undefined index: UserID in C:\wamp\www\tweetball\classes\word.class.php on line 35</p> <pre><code>&lt;?php session_start(); class Word { private $m_sWord; private $m_sMessage; private $link; public function __set($p_sProperty, $p_vValue) { switch($p_sProperty) { case "Message": $this-&gt;m_sMessage = $p_vValue; break; } } public function __get($p_sProperty) { $vResult = null; switch($p_sProperty) { case "Message": $vResult = $this-&gt;m_sMessage; break; } return $vResult; } public function Save() { include("Connection.php"); $sSql = "insert INTO words (word, FK_UserID) VALUES ('$_POST[message]','$_POST[UserID]')"; if ($rResult = mysqli_query($this-&gt;link, $sSql)) { echo ""; } else { throw new Exception('We could not save your word!'); } mysqli_close($this-&gt;link); } public function CreateNew() { $m_sHost = "localhost"; $m_sUser = "root"; $m_sPassword = ""; $m_sDatabase = "tweetball"; $link = mysqli_connect($m_sHost,$m_sUser,$m_sPassword,$m_sDatabase); if($link!=null){ $this-&gt;link=$link; } else { throw new Exception("There seems to be a database problem. Try again later"); } } public function getWord() { $m_sHost = "localhost"; $m_sUser = "root"; $m_sPassword = ""; $m_sDatabase = "tweetball"; $sSql = "select * from tweetball where WordID = 1;"; if ($rResult = mysqli_query($this-&gt;link, $sSql)) { $singleRecord = mysqli_fetch_assoc($rResult); $message = $singleRecord['Word']; } else { throw new Exception('We could get your word!'); } mysqli_close($link); return($message); } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload