Jump to content
MakeWebGames

Need Help ASAP


Calum

Recommended Posts

  • 6 months later...

"donatorday" Not building correctly

Hey, I kinda feel like an ass for reopening this dead topic but I am currently having a problem that is similar to this.

I've run ~/installer.php I've filled it out perfectly and then it comes to this.

Write Config...

Config written.

Attempting DB connection

Connection Successful.

Writing Main MySQL data.

Main MySQL data was written.

Now write Extra MySQL data.

QUERY ERROR: Unknown column 'donatordays' in 'field list'

Query was INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup) VALUES( '*****', '*****', md5('********'), 1, 100, 0, 0, 2, 12, 12, 100, 100, 5, 5, 100, 100, 1, '', unix_timestamp(), '*******', -1, '*******', '*******')

Now from what I have gotten from this is that in the .sql there is no section in where it creates the donatordays table. What I've written might be wrong so if anyone else knows how to fix it then can you reply?

Also, to everyone else. Yes, I have Removed all tables and rerun the installer at least 10 times. I just have a feeling that my .sql is missing some piece of code. I'll post it here so if anyone notices anything missing could you just shout out with the fix?

Cheers.

Code: http://pastebin.com/v7t9YvVT

Link to comment
Share on other sites

If you look at the tables he is installing it does include the `donatordays` in his users table. He also has the value set to '0' in his installer query. I am wondering though if the installer file is missing some quotes maybe around the query.

This is the original query that goes into the installer ... I'm not sure if that will help you or not.

 

$db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, 
user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, 
email, bankmoney, lastip, lastip_signup) VALUES( '{$username}', '{$username}', md5('{$_POST['a_password']}'),
1, 100, 0, 0, 2, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['a_gender']}', unix_timestamp(), '{$_POST['a_email']}',
-1, '$IP', '$IP')"); 
Link to comment
Share on other sites

@Newttster. That's exactly what I have to in the php.

@ShadyCoco. I knew that I had to add "donatordays" to the database but I wasn't sure what fields need to be placed there and what details needed to be added in. Is there anyone here that would be able to help with the .sql code to create the table and all relevant information for "donatordays"?

This is an example code that I pulled from a random website, I'm not sure what to add. So if anyone can help with this I will appreciate it so much.

Thanks in advance.

-- --------------------------------------------------------

--

-- Table structure for table `donatordays`

--

CREATE TABLE `donatordays` (

`*****` int(11) NOT NULL auto_increment,

`*****` int(11) NOT NULL default '0',

`****` int(11) NOT NULL default '0',

`***` int(11) NOT NULL default '0',

PRIMARY KEY (`*****`)

) ENGINE=***** ;

 

EDIT: :D I got it working, Now I just got to get all the Mysql to work. Anyone willing to help me out? I'll have to give you a bit of control over the Php Admin.

Edited by ajack38
Link to comment
Share on other sites

After just a quick read of the last posts, please make sure you know what you need to add! There is a big difference between the error "no such table" and "unknown column x in field list". For the last error, you just need to add a field in your table and not create a new table. If I can recall correctly, mcc uses a single field for this in the users table.

Link to comment
Share on other sites

Okay, I've got all the Mysql working and now it is just the PHP that is annoying me. I am reading about it on a few websites and I'm slowly starting to understand it, but a few pieces of code aren't working.

This is the code for one of my pages and it comes up with the error: Parse error: syntax error, unexpected '/' in /home/crimecit/public_html/criminal.php on line 14

 

<?php

$macropage="criminal.php";

include "globals.php";

if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); }

$q2=$db->query("SELECT * FROM crimes ORDER BY crimeBRAVE ASC");

while ($r2=$db->fetch_row($q2))

{

$crimes[]=$r2;

}

$q=$db->query("SELECT * FROM crimegroups ORDER by cgORDER ASC");

print "<b>Criminal Centre</b><br />

<tbody><tr>

<td bgcolor="#999999" colspan="3"><div align="center"><strong>Crime</strong></div></td>

</tr>

<tr bgcolor="#DFDFDF" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#DFDFDF'" onclick="document.getElementById('1').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; ">

 

<td width="1%"><img src="/images/crimes/a.png"></td>

<td><b>     Search for cash</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-2 Nerve</span>

 

</td>

<td width="35"><center><input id="1" type="RADIO" name="crime" value="searchstreets" checked="">

</center></td>

</tr>

<tr bgcolor="#CCCCCC" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#CCCCCC'" onclick="document.getElementById('2').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(204, 204, 204); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/b.png"></td>

<td><b>     Sell copied media</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-3 Nerve</span>

</td>

<td width="35"><center><input id="2" type="RADIO" name="crime" value="sellcopiedcds">

</center></td>

</tr>

<tr bgcolor="#DFDFDF" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#DFDFDF'" onclick="document.getElementById('3').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/c.png"></td>

<td><b>     Shoplift</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-4 Nerve</span>

</td>

<td width="35"><center><input id="3" type="RADIO" name="crime" value="shoplift">

</center></td>

</tr>

<tr bgcolor="#CCCCCC" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#CCCCCC'" onclick="document.getElementById('4').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(204, 204, 204); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/d.png"></td>

<td><b>     Pickpocket someone</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-5 Nerve</span>

</td>

<td width="35"><center><input id="4" type="RADIO" name="crime" value="pickpocket">

</center></td>

</tr>

<tr bgcolor="#DFDFDF" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#DFDFDF'" onclick="document.getElementById('5').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/e.png"></td>

<td><b>     Larceny</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-6 Nerve</span>

</td>

<td width="35"><center><input id="5" type="RADIO" name="crime" value="larceny">

</center></td>

</tr>

<tr bgcolor="#CCCCCC" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#CCCCCC'" onclick="document.getElementById('6').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(204, 204, 204); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/f.png"></td>

<td><b>     Armed Robberies</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-7 Nerve</span>

</td>

<td width="35"><center><input id="6" type="RADIO" name="crime" value="robsweetshop">

</center></td>

</tr>

<tr bgcolor="#DFDFDF" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#DFDFDF'" onclick="document.getElementById('7').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/g.png"></td>

<td><b>     Transport drugs</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-8 Nerve</span>

</td>

<td width="35"><center><input id="7" type="RADIO" name="crime" value="transportdrugs">

</center></td>

</tr>

<tr bgcolor="#CCCCCC" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#CCCCCC'" onclick="document.getElementById('8').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(204, 204, 204); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/h.png"></td>

<td><b>     Plant a computer virus</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-9 Nerve</span>

</td>

<td width="35"><center><input id="8" type="RADIO" name="crime" value="virus">

</center></td>

</tr>

<tr bgcolor="#DFDFDF" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#DFDFDF'" onclick="document.getElementById('9').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/i.png"></td>

<td><b>     Assassination</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-10 Nerve</span>

</td>

<td width="35"><center><input id="9" type="RADIO" name="crime" value="assasination">

</center></td>

</tr>

<tr bgcolor="#CCCCCC" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#CCCCCC'" onclick="document.getElementById('10').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(204, 204, 204); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/j.png"></td>

<td><b>     Arson</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-11 Nerve</span>

</td>

<td width="35"><center><input id="10" type="RADIO" name="crime" value="arson">

</center></td>

</tr>

<tr bgcolor="#DFDFDF" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#DFDFDF'" onclick="document.getElementById('11').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/k.png"></td>

<td><b>     Grand Theft Auto</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-12 Nerve</span>

</td>

<td width="35"><center><input id="11" type="RADIO" name="crime" value="gta">

</center></td>

</tr>

<tr bgcolor="#CCCCCC" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#CCCCCC'" onclick="document.getElementById('12').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(204, 204, 204); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/l.png"></td>

<td><b>     Pawn Shop</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-13 Nerve</span>

</td>

<td width="35"><center><input id="12" type="RADIO" name="crime" value="pawnshop">

</center></td>

</tr>

<tr bgcolor="#DFDFDF" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#DFDFDF'" onclick="document.getElementById('13').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/m.png"></td>

<td><b>     Counterfeiting</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-14 Nerve</span>

</td>

<td width="35"><center><input id="13" type="RADIO" name="crime" value="counterfeiting">

</center></td>

</tr>

<tr bgcolor="#CCCCCC" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#CCCCCC'" onclick="document.getElementById('14').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(204, 204, 204); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/n.png"></td>

<td><b>     Kidnapping</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-15 Nerve</span>

</td>

<td width="35"><center><input id="14" type="RADIO" name="crime" value="kidnapping">

</center></td>

</tr>

<tr bgcolor="#DFDFDF" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#DFDFDF'" onclick="document.getElementById('15').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/o.png"></td>

<td><b>     Arms Trafficking</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-16 Nerve</span>

</td>

<td width="35"><center><input id="15" type="RADIO" name="crime" value="armstraffic">

</center></td>

</tr>

<tr bgcolor="#CCCCCC" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#CCCCCC'" onclick="document.getElementById('16').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(204, 204, 204); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/p.png"></td>

<td><b>     Bombings</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-17 Nerve</span>

</td>

<td width="35"><center><input id="16" type="RADIO" name="crime" value="bombings">

</center></td>

</tr>

<tr bgcolor="#DFDFDF" onmouseover="this.style.background='#AABBCC';this.style.cursor='pointer'" ;="" onmouseout="this.style.background='#DFDFDF'" onclick="document.getElementById('17').checked=true; document.crimes.submit();" style="cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; ">

<td width="1%"><img src="/images/crimes/q.png"></td>

<td><b>     Hacking</b>

<br>     <span style="font-family: Arial; font-size: 9; color:#CC0000 ">-18 Nerve</span>

</td>

<td width="35"><center><input id="17" type="RADIO" name="crime" value="hacking">

</center></td>

 

</tr><tr bgcolor="#999999">

 

<td colspan="3"><div align="center"><input name="docrime" type="submit" id="docrime" value="Next Step"></div></td>

</tr></tbody>

while($r=$db->fetch_row($q))

{

print "<tr><td colspan='3' class='h'>{$r['cgNAME']}</td></tr>";

foreach($crimes as $v)

{

if($v['crimeGROUP'] == $r['cgID'])

{

print "<tr><td>{$v['crimeNAME']}</td><td>{$v['crimeBRAVE']} Brave</td><td><a href='docrime.php?c={$v['crimeID']}'>Do</a></td></tr>";

}

}

}

print "</table>";

$h->endpage();

?>

Link to comment
Share on other sites

Hi ajack38,

Make sure to use [ code] tags or [ php] tags.

I'll give you a hint on your errors. Fixing the line 14 error will produce many more.

On line 11 note that it says print ". If the quotes are ", inside the speech marks or double quotes need to be single, or an error will appear. You can escape these quotes with \ or change them to '. Like so, here's line 11-15

 

print "<b>Criminal Centre</b><br />
<tbody><tr>
<td bgcolor='#999999' colspan='3'><div align='center'><strong>Crime</strong></div></td>
</tr>
<tr bgcolor='#DFDFDF' onmouseover=\"this.style.background='#AABBCC';this. style.cursor='pointer'\" ;='' onmouseout=\"this.style.background='#DFDFDF'\" onclick=\"document.getElementById('1').checked=true ; document.crimes.submit();\" style=\"cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(223, 223, 223); background-position: initial initial; background-repeat: initial initial; \">

 

Not sure if that will work but its 3:30 am so try it, and it should be ok

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