569 Posted Topics

Member Avatar for websponge

Try this: $value = .$row[booleanresult]; if ($value) { // if true $value = "YES"; } else { $value = "NO"; }

Member Avatar for websponge
0
758
Member Avatar for eilrac

@L7Sqr >> something that you are familiar with. Starting from scratch and expecting to be successful is not always the best approach. I did my thesis on Signal Processing / Speech Recognition, something I hadn't even touched or researched before.. I get your point though, good advice :)!

Member Avatar for L7Sqr
0
135
Member Avatar for ucvx32

Ok, so I don't know if this is what you are looking for: #include <iostream> using namespace std; template<typename Type> class Events { public: virtual void add() { Type s; s.add(); } }; class Coord { public: void add() { cout << "Added Coord" << endl; } }; class Zone …

Member Avatar for ucvx32
0
133
Member Avatar for MachDelta

First question: Where do you define: for(;i<right && (data[i]<=data[pivot]);i++) { compares++; } compares? Second of all, you have function declartion: vector<int> quickSort(vector<int> &data, int left, int right) { This assumes that it has a return type, so therefore is expecting a vector of ints to be returned. BUT you send …

Member Avatar for ken_taiken
0
228
Member Avatar for mpc123

Insead of: <h2><a href="' . $row['$txt2'] . '/' . $row['$txt2'] . '.php">' . $row['title'] . '</a></h2> </div> Try: <h2><a href="' . $row['txt2'] . '/' . $row['txt2'] . '.php">' . $row['title'] . '</a></h2> </div> I don't understand the purpose of '$txt2' etc here, in this context.

Member Avatar for AndreRet
0
113
Member Avatar for NardCake

Hey, You can use Regex, because you didn't submit any example code, I did an example which hopefully you can follow: <?php $string = "faaf2424_"; if(preg_match('/^[a-z_\-\d]{3,}$/i', $string)) { echo 'Allowed'; }else{ echo 'Not allowed :('; } ?> This would display 'Allowed' whereas if the string was this: $string = "@24@24@"; …

Member Avatar for phorce
0
167
Member Avatar for dean.ong.14

Hey, I tried to run the code you've posted and it shows an indentation error. Is this the way that DaniWeb has formatted it, or, is it your code? I don't get what you're trying to ask, is your question regarding the fact that "random" cannot be imported, or, to …

Member Avatar for dean.ong.14
0
451
Member Avatar for phphelp123

unset the session to determine that someone is signed out? I.e. http://php.about.com/od/advancedphp/ss/php_sessions_3.htm

Member Avatar for Zagga
0
102
Member Avatar for matusekm

Hey, yes! I like to do it this way though, it's personal preference but: <?php if(!isset($_POST['name'])) { echo 'You have not submitted your name'; return 0; }else{ $name = $_POST['name']; } if(!isset($_POST['email'])) { echo 'You have not submitted your email'; return 0; }else{ $email = $_POST['email']; } if(!isset($_POST['message'])) { echo …

Member Avatar for GliderPilot
0
176
Member Avatar for anna.lucas.5680

@anna.lucas - This is not the forum for such questions. "Artifical Remote Enrolement System"? Lol..

Member Avatar for phorce
0
105
Member Avatar for bdl365
Member Avatar for stanleyk

@Dani I didn't know ProgrammingForums existed! Is it owned by DaniWeb?

Member Avatar for Dani
0
80
Member Avatar for london-G
Member Avatar for zeroliken
0
116
Member Avatar for ralph1992

Are you asking how to implement inheritence? If so, such tasks take place primarly in your class definitions (.h) files, so, might be an idea to post them over the class implementation (.cpp). IMO. I don't get it though because inheritence usually has a "IS A", "CAN BE" Are you …

Member Avatar for phorce
0
8K
Member Avatar for adityasingh95

For one, don't use: #include <iostream.h> // this is bad // use this #include <iostream> // Don't use: void main() { } // Use: int main() { } You can't expect to use: cout, cin etc.. without declaring you're using the std namespace, so, before your "main" function, always put …

Member Avatar for L7Sqr
0
237
Member Avatar for nathaniscool99

Yeah, I don't see any other way than what @myk45 said. It's a static variable, meaning it's scope is the class only.

Member Avatar for deceptikon
0
267
Member Avatar for Carpetfizz

Your implementation of function definition is wrong: int zonePick(int foo); // class definition (prototype) The implementation should be the same: int zonePick(int foo) { } This also assumes that you're passing a variable, or a value to it: int zonePick(int foo); int main() { int foo = 10; int valueReturnedFromFunction …

Member Avatar for thendrluca
0
156
Member Avatar for xbat

Yeah @LastMitch is right, MYSQLI is easier to manage. I read somewhere that PDO means that you do not have to worry about SQL injection I don't know how true this is though

Member Avatar for veedeoo
0
221
Member Avatar for <M/>

Why so? I think anything with complex search algorithms that requires in-depth lexical analysis is complicated, so like Google!

Member Avatar for <M/>
1
164
Member Avatar for pars99

So basically: I'm guessing by this line: USHORT triangle, square, rectangle, circle; You're defining variables which can then be compareable, why? Also, your comparision is wrong, like this: if (shape = triangle) { ... } A single "=" indicates to the compiler that you are trying to initalise a variable …

Member Avatar for pars99
0
2K
Member Avatar for fishsticks1907
Member Avatar for shahai.ali

Ok, I kind of know what it is you're trying to achieve. If you're wanting it so when a user types a key down it comes up with suggestions, this is quite simply.. It is done with jQuery/Ajax =) To do the recommended searches is a little more complex, will …

Member Avatar for JorgeM
0
200
Member Avatar for vizz

Try this: (save it as .htaccess) and make sure it's in the correct folder (like localhost, www etc.) RewriteEngine on RewriteRule ^(.*)$ $1.php

Member Avatar for vizz
0
436
Member Avatar for phorce

Hello, So basically, I am trying to create a system based on the Singleton Pattern and I'm confused. If I have an Animal class, as well as a Cat class which is derived from Animal and then using a Singleton class will create a single object of which-ever class has …

Member Avatar for L7Sqr
0
224
Member Avatar for ryan.ingram.54

How are you connecting? Wireless or Wired? Have you tried contacting your ISP directly? If you're using wireless, why not try using wired (ethernet) and see if you disconnect. Hope this helps a bit :)!

Member Avatar for phorce
0
129
Member Avatar for SimonFrance

Hello, Do you expect someone to code this for you, for free? That's just plain cheeky!! There are freelance websites out there, obviously, they'll charge you!!

Member Avatar for SimonFrance
0
106
Member Avatar for eharrell

Hey, I would do this using a SWITCH statement, over an if statement - If I'm honest. I haven't completeled this, but, look at this logic.. It might help you. Re-write the code for your own use, don't just use it! #include <iostream> using namespace std; int hoursToStudy(char grade) { …

Member Avatar for eharrell
0
109
Member Avatar for meby mathew

>>and then apply inheritance in your classes. >>No to both; you've already been told which classes to write, and there is no inheritance relationship involved: Shouldn't some relationship be here though? Ok, so inheritence can have a "Is a"/"Can Be" relationship so obviously "Customer" {is a} "Item" wouldn't work, however, …

Member Avatar for gusano79
0
103
Member Avatar for raj-uk

It's called Google, been around for a very long time and has a really nice UI you can use ;)

Member Avatar for diafol
-2
354
Member Avatar for johnef_sh

This code: if($SM_pro){ Basically is saying if SM_pro == true, however, DM_pro is an array, so, therefore it won't return true/false. You could try: if($SM_pro <= 0) { Alternatively, you could use the mysqi_num_rows() function.. http://www.nusphere.com/kb/phpmanual/function.mysqli-num-rows.htm Hope this helps :)

Member Avatar for phorce
0
578

The End.