Author Topic: A problem with messaging using XAMP  (Read 1813 times)

Offline Wakish

  • Level 14
  • *
  • Posts: 111
  • Reputation: +0/-1
    • View Profile
    • Wakish Wonderz
A problem with messaging using XAMP
« on: October 21, 2007, 11:02:17 AM »
Hi guys..
I'm having a problem.. the "messaging" system of any php games is not working under XAMP.. But with others like WAMP and EasyPhp, it is working.
I need to work with XAMP for the moment, can anyone try to help me with this issue?

Thanks!
- Wakish -

Offline Aliss

  • Level 9
  • *
  • Posts: 54
  • Reputation: +1/-1
    • View Profile
Re: A problem with messaging using XAMP
« Reply #1 on: October 22, 2007, 11:00:37 AM »
Say better for what game you need that messaging or if that is your made game show us a source only that we can help you width your problem.

Offline Wakish

  • Level 14
  • *
  • Posts: 111
  • Reputation: +0/-1
    • View Profile
    • Wakish Wonderz
Re: A problem with messaging using XAMP
« Reply #2 on: October 23, 2007, 06:27:50 AM »
Say better for what game you need that messaging or if that is your made game show us a source only that we can help you width your problem.

It has nothing to do with the codes! It's with the settings of XAMP.. I thought that perhaps someone here is using XAMP?

I have asked for help on XAMP's forum, but there support is very poor! No answer since almost 3 days now..
« Last Edit: October 23, 2007, 06:30:04 AM by wakish »

Offline Zeggy

  • Global Moderator
  • Level 35
  • *****
  • Posts: 1,187
  • Reputation: +13/-4
    • View Profile
Re: A problem with messaging using XAMP
« Reply #3 on: October 23, 2007, 06:40:47 AM »
I use XAMPP, but for me everything works fine...

Offline Wakish

  • Level 14
  • *
  • Posts: 111
  • Reputation: +0/-1
    • View Profile
    • Wakish Wonderz
Re: A problem with messaging using XAMP
« Reply #4 on: October 23, 2007, 07:10:17 AM »
I use XAMPP, but for me everything works fine...

I'm using the new version of XAMP.. do you think this might be a bug?
I have tried XAMP both on linux and WinXP.. still I get same problem on both..
But as I said, with WAMP on WinXP, I don't have any problem..

That's a strange problem :(

Offline codestryke

  • Administrator
  • Level 33
  • *****
  • Posts: 589
  • Reputation: +22/-0
    • View Profile
    • eXtremeCast Games
Re: A problem with messaging using XAMP
« Reply #5 on: October 26, 2007, 06:05:20 PM »
I may have an explanation but it's been a bit since you last posted so you may have already found out the problem? If not lemme know and I'll post further...
Creating online addictions, one game at a time:

Offline Zeggy

  • Global Moderator
  • Level 35
  • *****
  • Posts: 1,187
  • Reputation: +13/-4
    • View Profile
Re: A problem with messaging using XAMP
« Reply #6 on: October 29, 2007, 12:27:24 PM »
Hmm, now I got a problem that's happening on my XAMPP installation...

I have this query:
select `msg` from `log_gm`

If I change it to this:
select `msg` from `log_gm` order by `id` desc limit 1

Apache just hangs, and I have to restart it. If there something wrong with the query/code, or is my XAMPP just messed up?

The same query works fine on other pages, just not on index.php.

Offline Wakish

  • Level 14
  • *
  • Posts: 111
  • Reputation: +0/-1
    • View Profile
    • Wakish Wonderz
Re: A problem with messaging using XAMP
« Reply #7 on: November 18, 2007, 12:18:59 PM »
I may have an explanation but it's been a bit since you last posted so you may have already found out the problem? If not lemme know and I'll post further...

No I have not been able to work around this error on XAMP
But on easyPhp it's fine.
But I want to use linux and Xampp

Can you help me please?

The error reported is:
Quote
Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads='0'' at line 7

Code: [Select]
/* ***PHP CODES*** */
mysql_query("INSERT INTO messages
(recipient,user,name,content,mytime,reads) VALUES('$target','$user->username','$thrd_title',content='$thrd_content',mytime='$time',reads='0') ")
or die(mysql_error());

/* *** SQL details*** */
ID int(10)
recipient varchar(225)
user varchar(225)
name varchar(225)
content text
mytime int(11)
reads int(1)

I cannot figure out why this reports an error ONLY with XAMPP
« Last Edit: November 18, 2007, 12:21:11 PM by wakish »

Offline codestryke

  • Administrator
  • Level 33
  • *****
  • Posts: 589
  • Reputation: +22/-0
    • View Profile
    • eXtremeCast Games
Re: A problem with messaging using XAMP
« Reply #8 on: November 18, 2007, 02:32:32 PM »
You've got your INSERT with SET statments goofed up ;)

Code: [Select]
mysql_query("INSERT INTO messages
(recipient,user,name,content,mytime,reads) VALUES('$target','$user->username','$thrd_title','$thrd_content','$time','0') ")
or die(mysql_error());

With inserts you don't use field name = value

You just use values ;)


Creating online addictions, one game at a time:

Offline Wakish

  • Level 14
  • *
  • Posts: 111
  • Reputation: +0/-1
    • View Profile
    • Wakish Wonderz
Re: A problem with messaging using XAMP
« Reply #9 on: November 19, 2007, 02:09:00 AM »
Codestryke actually I wrote the code properly, but here I can't believe how I messed it up while wrting, I guessed I was very tired.. I barely slept..lol  -_-

I get the error still
Quote
Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads='0'' at line 7

Everytime it's the near "reads"... I can;t figure out where is the error..

Offline Wakish

  • Level 14
  • *
  • Posts: 111
  • Reputation: +0/-1
    • View Profile
    • Wakish Wonderz
Re: A problem with messaging using XAMP
« Reply #10 on: November 19, 2007, 05:08:48 AM »
============= UPDATED - SUCCESS =============

Ok after 2 days messing around with all types of possible solutions, here is my report and obervations:

1) I changed the "type" of reads to char, int, varchar - FAILURE
2) I changed the values to default,null..etc..etc - FAILURE
3) tried all possible syntax - FAILURE

PS: But most of time was wasted just starring in vain at the code  :mib: hah  :'(

4) I just RENAMED 'reads' as 'readss' - SUCCESS

Conclusion:
=> Perhaps "reads" is an internal reserved like word in Lampp ?

Any, I was going to "throw" lampp away, but I'm happy I finally reslved this problem.
« Last Edit: November 19, 2007, 05:12:57 AM by wakish »

Offline codestryke

  • Administrator
  • Level 33
  • *****
  • Posts: 589
  • Reputation: +22/-0
    • View Profile
    • eXtremeCast Games
Re: A problem with messaging using XAMP
« Reply #11 on: November 20, 2007, 05:47:41 AM »
Nice job!!!

With SQL if the word you are using is a reserved work then you can add the tick around the field name to let SQL know you are referencing a field name rather then the reserved work...

ie..


Code: [Select]
mysql_query("INSERT INTO messages
(recipient,user,name,content,mytime,`reads`) VALUES('$target','$user->username','$thrd_title','$thrd_content','$time','0') ")
or die(mysql_error());
Creating online addictions, one game at a time:

Offline Wakish

  • Level 14
  • *
  • Posts: 111
  • Reputation: +0/-1
    • View Profile
    • Wakish Wonderz
Re: A problem with messaging using XAMP
« Reply #12 on: November 22, 2007, 05:39:54 AM »
Nice job!!!

With SQL if the word you are using is a reserved work then you can add the tick around the field name to let SQL know you are referencing a field name rather then the reserved work...

ie..


Code: [Select]
mysql_query("INSERT INTO messages
(recipient,user,name,content,mytime,`reads`) VALUES('$target','$user->username','$thrd_title','$thrd_content','$time','0') ")
or die(mysql_error());

Thanks CodeStryke.. I did not know about the "tick around"...thanks mate!

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal