• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 00:08
CET 06:08
KST 14:08
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
StarCraft Evolution League (SC Evo Biweekly) RSL Offline Finals Info - Dec 13 and 14! RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion Which season is the best in ASL? Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET [Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
ZeroSpace Megathread Stormgate/Frost Giant Megathread Nintendo Switch Thread The Perfect Game Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1436 users

The Big Programming Thread - Page 329

Forum Index > General Forum
Post a Reply
Prev 1 327 328 329 330 331 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Yoshi-
Profile Joined October 2008
Germany10227 Posts
Last Edited: 2013-07-24 21:11:59
July 24 2013 20:54 GMT
#6561
On July 25 2013 05:44 tofucake wrote:
There are a bunch of php websocket libraries. socketo.me is probably the most well known. And even without that PHP still supports sockets (I made a bnet bot in php+ajax almost a decade ago).


Yea I know I already realized that and removed that part.

On July 25 2013 05:43 fdsdfg wrote:

Isn't google chat (chat from the gmail web interface) done using ajax?


Just did a quick check doesn't look like ajax, or at least the firebug console doesn't show any ajax request that could be related to it.
Yea, they use long polling or httpstreaming for it: http://stackoverflow.com/questions/2440135/is-long-polling-the-most-efficient-way-to-create-a-web-real-time-app/2440150#2440150
They arguably uses "Ajax", but not the same way how OP does
nunez
Profile Blog Joined February 2011
Norway4003 Posts
July 24 2013 20:55 GMT
#6562
On July 25 2013 05:28 fdsdfg wrote:
Show nested quote +
On July 25 2013 05:12 czaku wrote:
On July 25 2013 04:54 tofucake wrote:
On July 25 2013 04:32 czaku wrote:
Hi guys, i'd need some help from you, a couple of questions to be answered.
A friend of mine has a project to do during holidays. She needs to low level format whole HDD (this means filling each byte with 0x0). And now it begins. It cannot show any dialog, so calling system("format c:/") is not an option.
I've seen some codes in C++ but i'd prefer it to be C as i have it in school (basically whole theory covered so i only need experience and research) so i can understand your tips better. Is it even possible in C? In C++ i can try using CreateFile() and then ReadFile(), WriteFile() with HDD. But then i thought of bad sectors and it snared me.
Any tips where i can start?

Why?


It's a project to pass the next semester from programming and she is not interested in learning it. So she asked for my help. Basically you show the teacher code, explain how it works and you passed.


On July 25 2013 05:00 fdsdfg wrote:
On July 25 2013 04:32 czaku wrote:
Hi guys, i'd need some help from you, a couple of questions to be answered.
A friend of mine has a project to do during holidays. She needs to low level format whole HDD (this means filling each byte with 0x0). And now it begins. It cannot show any dialog, so calling system("format c:/") is not an option.
I've seen some codes in C++ but i'd prefer it to be C as i have it in school (basically whole theory covered so i only need experience and research) so i can understand your tips better. Is it even possible in C? In C++ i can try using CreateFile() and then ReadFile(), WriteFile() with HDD. But then i thought of bad sectors and it snared me.
Any tips where i can start?


Just write a 1-line batch file that calls format and throws the output away. You're reinventing the wheel if you try to write a new format utility for no reason.



The problem is it has to be in C/C++ and i prefer C at the moment.


You're asking for help on writing your friend's school project for her? She should fail if she can't learn the stuff. Programmers work on teams, and I wouldn't wish a useless teammate on any fellow programmer, which is what you're trying to inflict.


i too enjoy moralizing instead of shutting up when i am unable to answer.
conspired against by a confederacy of dunces.
KainiT
Profile Joined July 2011
Austria392 Posts
July 24 2013 20:58 GMT
#6563
On July 25 2013 05:02 LukeNukeEm wrote:
Hi, I have a question for the c++-gurus:
given
template<class T = void>
class foo
{
};

int main(void)
{
foo<> foo1;
foo<int> foo2;
}
and that I am lazy, is there a way to make
foo foo1;
foo<int> foo2;
legal?
I know i can do this
namespace detail
{
template<class T = void>
class foo
{
};
}
using foo = detail::foo<>;

int main(void)
{
foo foo1;
detail::foo<int> foo2;
}
, but now i have to write detail:: for every class with a non-default template parameter.
Is there any magic available to make this work, perhaps with template aliases?


I am afraid there isn't, but I do not really get your "problem". Writing "<>" is too much work? I find it helpful that the compiler makes one aware of which classes are actually templated.
With great power comes great responsibility.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-07-24 21:18:31
July 24 2013 21:16 GMT
#6564
I've got a question from a relative today what a programmer is supposed to do when it comes to "domain requirements", e.g. it's required from you to create software that will be used in (say) architecture development or any other non-computer field really. The problem is you're a software engineer not an architect, physician or whatever.

What I answered was that the contractor of the project (or the manager) should be responsible to teach/give enough material to programmers to fullfill application requirements. However, is this what's done in practice? Am I close to truth?

Edit: The purpose of the question was that he thinks everyone should understand everything even if it's just a little bit.
1handsomE
Profile Blog Joined July 2011
United States199 Posts
Last Edited: 2013-07-24 21:22:32
July 24 2013 21:22 GMT
#6565
Hi. I am a relatively junior level programmer (2 years professional experience) who just got an actual programming job (UI Programmer) in the game industry. I was wondering if there was anyone else on the forums who works in the industry?

Edit: DM me, let's be friends!
MarineKing / Jaedong / DeMusliM / SeleCT / Maru hwaiting!
fdsdfg
Profile Blog Joined February 2010
United States1251 Posts
July 24 2013 22:08 GMT
#6566
On July 25 2013 05:55 nunez wrote:
Show nested quote +
On July 25 2013 05:28 fdsdfg wrote:
On July 25 2013 05:12 czaku wrote:
On July 25 2013 04:54 tofucake wrote:
On July 25 2013 04:32 czaku wrote:
Hi guys, i'd need some help from you, a couple of questions to be answered.
A friend of mine has a project to do during holidays. She needs to low level format whole HDD (this means filling each byte with 0x0). And now it begins. It cannot show any dialog, so calling system("format c:/") is not an option.
I've seen some codes in C++ but i'd prefer it to be C as i have it in school (basically whole theory covered so i only need experience and research) so i can understand your tips better. Is it even possible in C? In C++ i can try using CreateFile() and then ReadFile(), WriteFile() with HDD. But then i thought of bad sectors and it snared me.
Any tips where i can start?

Why?


It's a project to pass the next semester from programming and she is not interested in learning it. So she asked for my help. Basically you show the teacher code, explain how it works and you passed.


On July 25 2013 05:00 fdsdfg wrote:
On July 25 2013 04:32 czaku wrote:
Hi guys, i'd need some help from you, a couple of questions to be answered.
A friend of mine has a project to do during holidays. She needs to low level format whole HDD (this means filling each byte with 0x0). And now it begins. It cannot show any dialog, so calling system("format c:/") is not an option.
I've seen some codes in C++ but i'd prefer it to be C as i have it in school (basically whole theory covered so i only need experience and research) so i can understand your tips better. Is it even possible in C? In C++ i can try using CreateFile() and then ReadFile(), WriteFile() with HDD. But then i thought of bad sectors and it snared me.
Any tips where i can start?


Just write a 1-line batch file that calls format and throws the output away. You're reinventing the wheel if you try to write a new format utility for no reason.



The problem is it has to be in C/C++ and i prefer C at the moment.


You're asking for help on writing your friend's school project for her? She should fail if she can't learn the stuff. Programmers work on teams, and I wouldn't wish a useless teammate on any fellow programmer, which is what you're trying to inflict.


i too enjoy moralizing instead of shutting up when i am unable to answer.


If he asked for $20 and you didn't send him $20, would it be right to assume that you don't have $20 to your name?
aka Siyko
RoyGBiv_13
Profile Blog Joined August 2010
United States1275 Posts
Last Edited: 2013-07-24 22:22:52
July 24 2013 22:20 GMT
#6567
On July 25 2013 06:16 darkness wrote:
I've got a question from a relative today what a programmer is supposed to do when it comes to "domain requirements", e.g. it's required from you to create software that will be used in (say) architecture development or any other non-computer field really. The problem is you're a software engineer not an architect, physician or whatever.

What I answered was that the contractor of the project (or the manager) should be responsible to teach/give enough material to programmers to fullfill application requirements. However, is this what's done in practice? Am I close to truth?

Edit: The purpose of the question was that he thinks everyone should understand everything even if it's just a little bit.


Probably not a bad idea to understand the industry in which your code will be running. In particular, there are script compliance rules for certain industries which require obnoxious certifications in order to have use your code.
Check out MISRA for automotive, for example.
http://en.wikipedia.org/wiki/MISRA_C
In this sense, an 'industry panel of experts' has strict rules regarding what features of the language you can use, and how you should use them. It even has rules about benign features, like whitespace. Some certifications require some really strange stuff, like a clean desk, and showing up on time to work as part of the software requirements. I guess it makes sense that if you control the programmer's level of reliability, then his code ought to be more reliable as well. I figure that in pratice, there have been very few software bugs in certified environments, like automotive, space, trains, medical, architecture, etc...

+ Show Spoiler +
Probably worth noting that code that is to specifications is usually 10x harder to debug than hacked together garbage from a jr. dev .
Any sufficiently advanced technology is indistinguishable from magic
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-07-24 23:07:45
July 24 2013 23:05 GMT
#6568
On July 25 2013 07:20 RoyGBiv_13 wrote:
Show nested quote +
On July 25 2013 06:16 darkness wrote:
I've got a question from a relative today what a programmer is supposed to do when it comes to "domain requirements", e.g. it's required from you to create software that will be used in (say) architecture development or any other non-computer field really. The problem is you're a software engineer not an architect, physician or whatever.

What I answered was that the contractor of the project (or the manager) should be responsible to teach/give enough material to programmers to fullfill application requirements. However, is this what's done in practice? Am I close to truth?

Edit: The purpose of the question was that he thinks everyone should understand everything even if it's just a little bit.


Probably not a bad idea to understand the industry in which your code will be running. In particular, there are script compliance rules for certain industries which require obnoxious certifications in order to have use your code.
Check out MISRA for automotive, for example.
http://en.wikipedia.org/wiki/MISRA_C
In this sense, an 'industry panel of experts' has strict rules regarding what features of the language you can use, and how you should use them. It even has rules about benign features, like whitespace. Some certifications require some really strange stuff, like a clean desk, and showing up on time to work as part of the software requirements. I guess it makes sense that if you control the programmer's level of reliability, then his code ought to be more reliable as well. I figure that in pratice, there have been very few software bugs in certified environments, like automotive, space, trains, medical, architecture, etc...

+ Show Spoiler +
Probably worth noting that code that is to specifications is usually 10x harder to debug than hacked together garbage from a jr. dev .


That MISRA stuff is interesting. Especially this:

Avoiding using functions and constructs that are prone to failure, for example, malloc may fail.


What do they use instead of malloc? Is there even an alternative to it for dynamic memory assuming they need one?

Plus, this seems like underestimating malloc imho. You can always:


if (variable != NULL) {
...
}
else {
printf("Screw you\n");
}
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2013-07-24 23:24:33
July 24 2013 23:14 GMT
#6569
double post
There is no one like you in the universe.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2013-07-24 23:32:01
July 24 2013 23:24 GMT
#6570
On July 25 2013 05:12 czaku wrote:
Show nested quote +
On July 25 2013 05:00 fdsdfg wrote:
On July 25 2013 04:32 czaku wrote:
Hi guys, i'd need some help from you, a couple of questions to be answered.
A friend of mine has a project to do during holidays. She needs to low level format whole HDD (this means filling each byte with 0x0). And now it begins. It cannot show any dialog, so calling system("format c:/") is not an option.
I've seen some codes in C++ but i'd prefer it to be C as i have it in school (basically whole theory covered so i only need experience and research) so i can understand your tips better. Is it even possible in C? In C++ i can try using CreateFile() and then ReadFile(), WriteFile() with HDD. But then i thought of bad sectors and it snared me.
Any tips where i can start?


Just write a 1-line batch file that calls format and throws the output away. You're reinventing the wheel if you try to write a new format utility for no reason.



The problem is it has to be in C/C++ and i prefer C at the moment.



You can run command line inside C++ using system() I think.



On July 25 2013 08:05 darkness wrote:
That MISRA stuff is interesting. Especially this:

Show nested quote +
Avoiding using functions and constructs that are prone to failure, for example, malloc may fail.


What do they use instead of malloc? Is there even an alternative to it for dynamic memory assuming they need one?

Plus, this seems like underestimating malloc imho. You can always:


Maybe they prefer if you used realloc and calloc? No clue :d


On July 25 2013 02:11 tec27 wrote:
Show nested quote +
On July 24 2013 18:33 WolfintheSheep wrote:
On July 24 2013 17:52 tec27 wrote:
On July 24 2013 17:29 Blisse wrote:
Programmers aren't Product Managers. Product Managers talk with higher-ups and Architects who may or may not communicate with Senior Developers before reaching decisions in what designs/implementation details are used in the product - way before you actually have a project to work on. Assuming you're not in very new start-ups, because for most programmers you'll be joining several years in and hopping right into their chosen language. Programmers rarely make real important implementation decisions unless there's a huge issue and/or oversight found.

Whatever company you work at sounds incredibly dysfunctional and you should seek new employment ASAPly

It sounds to me like you don't have much working experience in the field.

Most companies anywhere work like this. Architecture and frameworks are chosen by cost evaluation, programming languages are chosen based on software compatibility or legacy code, and projects are always set before programmers and low-level designers have heard anything except rumours.

And believe me, if you think that's dysfunctional, a company where programmers use whatever they want is several magnitudes worse.

So you think a company where PM's are deciding what technology you'll use and "Solution Architects" (who are clearly, in his example, *not* anyone actually touching the code) are making decisions from on high which you have no actual say in makes for a good place to work? I'm not trying to insult the company, I'm just trying to give advice. If you work at a place that does that, they're treating you like shit and you can do better. If you want to be treated like shit, then have at it


Well, Solution Architects need to touch the code in order to know what it can and cannot do. Not sure where you got the idea that they knew nothing about coding, most of them were previous programmers and moved up? You have a say in what you do. It's just your say is not relevant unless the architect completely missed something in the design requirements.


On July 25 2013 02:55 tec27 wrote:
Decent programmers are not going to say "I like python" and think that's a good reason for choosing it for a project. If your company doesn't trust you to be able to pick the right tool for the job, they think you're a moron and unless you actually believe you are a moron, you should find a new job. Its really not that difficult.

There are plenty of companies that will treat you like shit, I'm not arguing that they don't exist. I'm just saying that if you have any self-respect and desire to actually work effectively, you shouldn't work for them.


Do your companies actually allow you to pick your tools for the job? I'm not sure what kid of jobs we're describing here because I really don't think it's the same set. I'm not aware of jobs where you're given "arbitrary project" as a programmer and then management is like, "do it", and then you do it in whatever way you want. For the most part I would've thought sometime somewhere in management they've received design requirements from the customer and then they consulted with a consultant/architect on what can and cannot be done (who may consult with you if he/she requires), then they delegate the task to you and your programming team. Not sure what hierarchical system you're describing though.


Anyways, the way you describe this is like you're looking down on code monkeys, and while they're pretty bad, that's a huge reality of the profession and you shouldn't be an asshole about people who have to program in those environments and have yet to figure out they don't belong.
There is no one like you in the universe.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
July 24 2013 23:42 GMT
#6571
On July 25 2013 07:08 fdsdfg wrote:
Show nested quote +
On July 25 2013 05:55 nunez wrote:
On July 25 2013 05:28 fdsdfg wrote:
On July 25 2013 05:12 czaku wrote:
On July 25 2013 04:54 tofucake wrote:
On July 25 2013 04:32 czaku wrote:
Hi guys, i'd need some help from you, a couple of questions to be answered.
A friend of mine has a project to do during holidays. She needs to low level format whole HDD (this means filling each byte with 0x0). And now it begins. It cannot show any dialog, so calling system("format c:/") is not an option.
I've seen some codes in C++ but i'd prefer it to be C as i have it in school (basically whole theory covered so i only need experience and research) so i can understand your tips better. Is it even possible in C? In C++ i can try using CreateFile() and then ReadFile(), WriteFile() with HDD. But then i thought of bad sectors and it snared me.
Any tips where i can start?

Why?


It's a project to pass the next semester from programming and she is not interested in learning it. So she asked for my help. Basically you show the teacher code, explain how it works and you passed.


On July 25 2013 05:00 fdsdfg wrote:
On July 25 2013 04:32 czaku wrote:
Hi guys, i'd need some help from you, a couple of questions to be answered.
A friend of mine has a project to do during holidays. She needs to low level format whole HDD (this means filling each byte with 0x0). And now it begins. It cannot show any dialog, so calling system("format c:/") is not an option.
I've seen some codes in C++ but i'd prefer it to be C as i have it in school (basically whole theory covered so i only need experience and research) so i can understand your tips better. Is it even possible in C? In C++ i can try using CreateFile() and then ReadFile(), WriteFile() with HDD. But then i thought of bad sectors and it snared me.
Any tips where i can start?


Just write a 1-line batch file that calls format and throws the output away. You're reinventing the wheel if you try to write a new format utility for no reason.



The problem is it has to be in C/C++ and i prefer C at the moment.


You're asking for help on writing your friend's school project for her? She should fail if she can't learn the stuff. Programmers work on teams, and I wouldn't wish a useless teammate on any fellow programmer, which is what you're trying to inflict.


i too enjoy moralizing instead of shutting up when i am unable to answer.


If he asked for $20 and you didn't send him $20, would it be right to assume that you don't have $20 to your name?

depends on context.
conspired against by a confederacy of dunces.
DeltaX
Profile Joined August 2011
United States287 Posts
July 25 2013 00:00 GMT
#6572
On July 25 2013 08:24 Blisse wrote:

Do your companies actually allow you to pick your tools for the job? I'm not sure what kid of jobs we're describing here because I really don't think it's the same set. I'm not aware of jobs where you're given "arbitrary project" as a programmer and then management is like, "do it", and then you do it in whatever way you want. For the most part I would've thought sometime somewhere in management they've received design requirements from the customer and then they consulted with a consultant/architect on what can and cannot be done (who may consult with you if he/she requires), then they delegate the task to you and your programming team. Not sure what hierarchical system you're describing though.


Anyways, the way you describe this is like you're looking down on code monkeys, and while they're pretty bad, that's a huge reality of the profession and you shouldn't be an asshole about people who have to program in those environments and have yet to figure out they don't belong.


I think it depends on various factors including:

1. Size of team
2. Who came up with the project
3. Culture of organization (related to first 2)

If the team is going to be large and a "higher up" came up with the project, it is unlikely you will have much choice on something as core as the programming language or major tools that affect others. If on the other hand it is a smaller project, or you/your manager came up with the project idea yourselves and got it approved, then you could make almost any decision and as long as you can justify it, then go for it.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
July 25 2013 00:09 GMT
#6573
On July 25 2013 06:22 1handsomE wrote:
Hi. I am a relatively junior level programmer (2 years professional experience) who just got an actual programming job (UI Programmer) in the game industry. I was wondering if there was anyone else on the forums who works in the industry?

Edit: DM me, let's be friends!


oh damn nice job. I want to get into UI programming maybe UX design, though design doesn't really fit into programming. congrats.
There is no one like you in the universe.
ThatGuy
Profile Blog Joined April 2008
Canada695 Posts
July 25 2013 01:11 GMT
#6574
On July 25 2013 06:22 1handsomE wrote:
Hi. I am a relatively junior level programmer (2 years professional experience) who just got an actual programming job (UI Programmer) in the game industry. I was wondering if there was anyone else on the forums who works in the industry?

Edit: DM me, let's be friends!


Hia, yeah, I also do UI programming for Ubisoft . Good luck in the field!
phar
Profile Joined August 2011
United States1080 Posts
July 25 2013 03:34 GMT
#6575
On July 25 2013 08:05 darkness wrote:
What do they use instead of malloc? Is there even an alternative to it for dynamic memory assuming they need one?

Read up on the code they use on Mars. You don't use dynamic memory.
Who after all is today speaking about the destruction of the Armenians?
Fawkes
Profile Blog Joined May 2010
Canada1935 Posts
Last Edited: 2013-07-25 03:49:07
July 25 2013 03:44 GMT
#6576
A php related question.

I'm working on some old code written by someone who I can't really get a hold of anymore. Is there a reason why these two blocks of code work differently in php? I just started dabbling with php within the last month.


$sql = "select achievement from achievement_list";
$sql = $sql." where achievement_id = ";
echo "$sql<br>";

This echos
"select achievement from achievement_list where achievement_id = "


$sql = "select achievement from achievement_list where achievement_id = ";
echo "$sql<br>";

This echos nothing.

Another possibly somewhat related thing was trying this (this code is the same block as the first, except there's a value 1 at the end)

$sql = "select achievement from achievement_list";
$sql = $sql." where achievement_id = 1";
echo "$sql<br>";

This echos
"select achievement from achievement_list where achievement_id = " missing the 1.

I realize the first two queries don't actually do anything. With a quick glance from anyone experienced with php, is this something obvious I am missing or there may be more than meets the eye and I would need to investigate deeper?

My actual end goal was to end up doing something like

$sql = "select achievement from achievement_list";
$sql = $sql." where achievement_id = $achievementsel";
echo "$sql<br>";

which I was trying to pass it some selection menu's value when the form was submitted. But it wasn't working, so I simplified the query and then ended up with the weird situations above.
Taeyeon ~ Jennie ~ Seulgi ~ Irene @Fawkes711
tofucake
Profile Blog Joined October 2009
Hyrule19173 Posts
Last Edited: 2013-07-25 03:52:52
July 25 2013 03:50 GMT
#6577
They work as expected for me. There is likely something else you've left out is futzing with $sql
https://tofucake.net/fawkes.php
https://tofucake.net/fawkes.phps
Liquipediaasante sana squash banana
Fawkes
Profile Blog Joined May 2010
Canada1935 Posts
July 25 2013 03:54 GMT
#6578
Alright thanks. At least I know it is supposed to work.
Taeyeon ~ Jennie ~ Seulgi ~ Irene @Fawkes711
Fawkes
Profile Blog Joined May 2010
Canada1935 Posts
Last Edited: 2013-07-25 06:03:57
July 25 2013 04:45 GMT
#6579
Let me rewrite this to the simplest way possible.


$sql = "select achievement from achievement_list";

$sql = $sql." where achievement_id = 1";

//$sql = $sql." where achievement_id = ".$achievementsel;


$sql = "select achievement from achievement_list";

//$sql = $sql." where achievement_id = ".$achievementsel;

$sql = $sql." where achievement_id = 1";


These two chunks of code, are not doing the same thing for me and I have no idea why.

+ Show Spoiler [frustration x1000000000000] +


//$sql = "select achievement from achievement_list";

//$sql = $sql." where achievement_id = ".$achievementsel;

//$sql = $sql." where achievement_id = 1";

$sql = "select achievement from achievement_list where achievement_id = 1";
echo "$sql<br>";



$sql = "select achievement from achievement_list where achievement_id = 1";

//$sql = "select achievement from achievement_list";

//$sql = $sql." where achievement_id = ".$achievementsel;

//$sql = $sql." where achievement_id = 1";

echo "$sql<br>";


The first chunk of code prints "select achievement from achievement_list where achievement_id = 1". Second does nothing.
For the record, the code after these lines just perform the query using $sql.


Wow this is so inconsistent, I don't even know what is going on anymore.
Taeyeon ~ Jennie ~ Seulgi ~ Irene @Fawkes711
HardlyNever
Profile Blog Joined July 2011
United States1258 Posts
July 25 2013 05:08 GMT
#6580
The comments and line breaks shouldn't affect anything. It looks like it is supposed to pull "achievementse1" from some form or something where the user inputs that value. I can't really tell what else is supposed to be going on with what you have shown.
Out there, the Kid learned to fend for himself. Learned to build. Learned to break.
Prev 1 327 328 329 330 331 1032 Next
Please log in or register to reply.
Live Events Refresh
Replay Cast
00:00
WardiTV Mondays #62
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 201
trigger 54
StarCraft: Brood War
Tasteless 159
Shine 145
Bale 46
NaDa 34
Icarus 6
Dota 2
monkeys_forever684
NeuroSwarm125
League of Legends
JimRising 768
Counter-Strike
Coldzera 1487
Super Smash Bros
C9.Mang0377
Other Games
summit1g12538
shahzam539
WinterStarcraft456
ViBE170
Mew2King63
Organizations
Other Games
gamesdonequick998
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Hupsaiya 104
• Berry_CruncH54
• practicex 19
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 19
• Azhi_Dahaki3
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo808
Upcoming Events
The PondCast
4h 52m
OSC
10h 52m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
18h 52m
Korean StarCraft League
1d 21h
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
2 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
2 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
3 days
[ Show More ]
WardiTV 2025
3 days
OSC
3 days
BSL 21
3 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
4 days
Replay Cast
4 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
5 days
StarCraft2.fi
6 days
Tenacious Turtle Tussle
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.