Jump to content
MakeWebGames

Cronus Workshop


Recommended Posts

ok, so what it has come down to at this point I believe anyways is this

 

else
{
print"<table width=50% border=1><tr><th colspan=2>Adding An Item To The Workshop...</th></tr><tr><td><center>Item To Create:</center></td><td><center><br><form action='workshop.php?action=itemcreate' method='post'>
<select name=item>";
$nji=$db->query("SELECT * FROM items ORDER BY itmname ASC");
while ($list=$db->free_result($nji))
{
print"<option value=' .{$list['itmid']}. '>' .{$list['itmname']}. '</option>";
}
print"</select><br><br></td></tr>

 

Originally the ' . . ' where not there but I'm trying lol!

Issue is when attempting to make/select item to create the item list returns blank.

Link to comment
Share on other sites

ok tried

 

<select name=item>";
$nji=$db->query("SELECT * FROM items ORDER BY itmname ASC");
while ($list=mysqli_fetch_row($nji))
{
print"<option value=' .{$list['itmid']}. '>{$list['itmname']}</option>";
}

 

and still nothing

Edited by boionfire81
updated code
Link to comment
Share on other sites

In theory it should work and I want to thank you for attempting this yourself.

Just so you know, while() will execute the code in a loop as long as what's in the while as a parameter will return true. So basically what it's saying if you are not getting any results is that your query is not returning any rows or "ferching" and rows.

Now, what could potentially be your issue is that mysqli_fetch_row() doesn't actually exists. You have 2 choices and in order of best to worst I would change your mysqli_fetch_row() to $db->fetch_row() or change it to mysqli_stmt_fetch()

Link to comment
Share on other sites

ok, one last thing I hope. As now it's testing time. I want to fix this first

PHP Notice: Undefined index: action

for when there are workshop.php?action=blah

Someone told me once, but I lost that post. Wish I could save this one as a reference. But the like button doesn't work :/

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...