These are chat archives for FreeCodeCamp/Help

28th
Oct 2017
Henry
@GitHub-Henry
Oct 28 2017 01:41
@DarrenfJ Hello
Ken Haduch
@khaduch
Oct 28 2017 02:03

@gishy1 - I don't know if this will help you with the truncate a string challenge - I broke it into something like three cases. If num is greater than 4, the you want to reduce the length of the truncated string by three (because adding the dots will increase the length back to the desired value). So I calculated the final desired num value and performed the .slice() and then appended the three dots and returned it.

In other words - if you are supposed to truncate, figure out the length of the input string that you want, sometimes you want to shorted it by 3 (for the dots) then slice, add the dots, and return...

@DarrenfJ - hey Darren - how are things in Toronto?
Manish Giri
@Manish-Giri
Oct 28 2017 02:13
@khaduch @GitHub-Henry @korzo @DarrenfJ @heroiczero @thekholm80 ty
CamperBot
@camperbot
Oct 28 2017 02:13
manish-giri sends brownie points to @khaduch and @github-henry and @korzo and @darrenfj and @heroiczero and @thekholm80 :sparkles: :thumbsup: :sparkles:
:cookie: 427 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 2194 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 1961 | @heroiczero |http://www.freecodecamp.com/heroiczero
:cookie: 688 | @korzo |http://www.freecodecamp.com/korzo
:star2: 3419 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 1545 | @thekholm80 |http://www.freecodecamp.com/thekholm80
sanchitcop19
@sanchitcop19
Oct 28 2017 02:16
Hello!
I noticed one sentence on this page is after the image instead of its rightful place before it
The 'file a bug' section asked me to post this here
Henry
@GitHub-Henry
Oct 28 2017 02:18
@Manish-Giri hello, & ty
CamperBot
@camperbot
Oct 28 2017 02:18
github-henry sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6709 | @manish-giri |http://www.freecodecamp.com/manish-giri
Ken Haduch
@khaduch
Oct 28 2017 03:14
@sanchitcop19 - I would think that the best thing to do, since it's an article, would be to make a comment in the article's comment section? I don't see a "file a bug" link on that page maybe I just missed it? But I would try putting your information about the error in a command and see if the author responds. But it looks like the article and the most recent comments are from 2016 - no telling how responsive the author will be at this point in time? But try there - no one in this chat room here can fix the article. If you want another set of eyes to look at the article to confirm your findings, you can post some details here of what you think is not correct and see if folks from here agree?
Ken Haduch
@khaduch
Oct 28 2017 03:19
@Manish-Giri - thank you, as always, for your appreciation, and for your work here to help fellow campers!
CamperBot
@camperbot
Oct 28 2017 03:19
khaduch sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6710 | @manish-giri |http://www.freecodecamp.com/manish-giri
heroiczero
@heroiczero
Oct 28 2017 04:00
@GitHub-Henry @khaduch @korzo @Manish-Giri @DarrenfJ @thekholm80 @daddycardona @longnt80 @sjames1958gm TY
:sparkles: :) Have a nice weekend :) :sparkles: :
CamperBot
@camperbot
Oct 28 2017 04:00
heroiczero sends brownie points to @github-henry and @khaduch and @korzo and @manish-giri and @darrenfj and @thekholm80 and @daddycardona and @longnt80 and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 6711 | @manish-giri |http://www.freecodecamp.com/manish-giri
:cookie: 429 | @daddycardona |http://www.freecodecamp.com/daddycardona
:cookie: 689 | @korzo |http://www.freecodecamp.com/korzo
:star2: 3420 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 2195 | @darrenfj |http://www.freecodecamp.com/darrenfj
:cookie: 428 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 1546 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:cookie: 620 | @longnt80 |http://www.freecodecamp.com/longnt80
:star2: 8625 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Ken Haduch
@khaduch
Oct 28 2017 04:04
@heroiczero - thanks back at ya, and have a great weekend and catch you around the camp...
CamperBot
@camperbot
Oct 28 2017 04:04
khaduch sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1962 | @heroiczero |http://www.freecodecamp.com/heroiczero
Kyle Holm
@thekholm80
Oct 28 2017 04:18
@Manish-Giri @heroiczero @DarrenfJ @daddycardona ty
CamperBot
@camperbot
Oct 28 2017 04:18
thekholm80 sends brownie points to @manish-giri and @heroiczero and @darrenfj and @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 430 | @daddycardona |http://www.freecodecamp.com/daddycardona
:star2: 1963 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 6712 | @manish-giri |http://www.freecodecamp.com/manish-giri
:star2: 2196 | @darrenfj |http://www.freecodecamp.com/darrenfj
korzo
@korzo
Oct 28 2017 04:30
@heroiczero Thanks, nice weekend too
CamperBot
@camperbot
Oct 28 2017 04:30
korzo sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1964 | @heroiczero |http://www.freecodecamp.com/heroiczero
Manikanth
@manikanth1024
Oct 28 2017 05:44
hi all
is anyone worked on firebase push notifs ever?
sanchitcop19
@sanchitcop19
Oct 28 2017 05:56
@khaduch Thanks! That makes sense, sending an image
CamperBot
@camperbot
Oct 28 2017 05:56
sanchitcop19 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3421 | @khaduch |http://www.freecodecamp.com/khaduch
The line on the bottom had me looking for the way .git should look like before I realized it was above it
Henry
@GitHub-Henry
Oct 28 2017 06:22
@heroiczero hello & ty
CamperBot
@camperbot
Oct 28 2017 06:22
github-henry sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1965 | @heroiczero |http://www.freecodecamp.com/heroiczero
Jake
@JakeDVirus
Oct 28 2017 07:32
needed some pieces of information. i have no knowledge of backend. what are the things i have to learn to operate the backend context of the project if i choose node.js?
alpox
@alpox
Oct 28 2017 08:13
@NeelDVirus get yourself some good node tutorial. But be aware that there are some pretty bad ones :/
Also when you know basic node, look into express
I heard some bad things about learnyounode btw.
Jake
@JakeDVirus
Oct 28 2017 08:14
@alpox yeah i will do that. my concern is what are the other stuffs i have to learn for backend along with node.js
to handle a project
alpox
@alpox
Oct 28 2017 08:21
@NeelDVirus yes. Learn about REST services and get at least some knowledge of the http protocol
For a project, you usually also need a database so you might investigate there
Most people here use mongodb as example
Jake
@JakeDVirus
Oct 28 2017 08:30
@alpox yeah that are what i was asking about. so i got one more thing "Database (Mongo)". and what about MySql Sql and NoSql?
and for frontend, i am using js, jquery, css, sass. No react.js
alpox
@alpox
Oct 28 2017 08:43
@NeelDVirus Mongo is a NoSQL database
SQL databases are good to know, but take more time to learn and get used to. There is quite some data organization schon nce behind which one should at least a bit understand and together with learning other things that would be too much
Jake
@JakeDVirus
Oct 28 2017 08:46
@alpox Oops pardon. so there is two stuff i need to do through for backend. Node.js and MongoDb(NOSql). is there any other stuff i need to be concerned of??
Barkha54
@Barkha54
Oct 28 2017 08:57
Hello everyone, while starting the FCC project with gulp on my local machine I'm getting an error. Can someone please help me how to fix this issue?
image.png
alpox
@alpox
Oct 28 2017 08:58
@NeelDVirus youll get at the rest you need when going for a project with those things :)
@Barkha54
You get an object as parameter to the function reqHeaders which either has no urlor no hostnameproperty
If only hostname is missing, url would be defined because of the nesting of hostname
Barkha54
@Barkha54
Oct 28 2017 09:01
@alpox
This is my gulpfile.js
image.png
Could you please help me what I should replace hostname with in order to fix this issue. I tried with localhost but it didn't work.
alpox
@alpox
Oct 28 2017 09:08
@Barkha54 I believe hostname is not defined because you would have to give that as option
{
  ...
  proxy: {
    ...
    url: {
      hostname: "yourdomain.com"
    }
    reqHeaders: ...
  }
  ...
}
Barkha54
@Barkha54
Oct 28 2017 09:20
@alpox I tried with localhost but it is saying localhost is not defined. want to run the project on my local server
image.png
alpox
@alpox
Oct 28 2017 09:21
@Barkha54 You try to interpolate localhost - like this it looks for a variable named localhost
Just write: "http://localhost:3000"
And you did it in target
Not in url: { hostname: ... }
Jake
@JakeDVirus
Oct 28 2017 09:28
@alpox thanks for the advice
CamperBot
@camperbot
Oct 28 2017 09:28
neeldvirus sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1411 | @alpox |http://www.freecodecamp.com/alpox
Barkha54
@Barkha54
Oct 28 2017 09:28
@alpox I tried in 'url : { hostname: ... }' but it is saying unexpected string
image.png
alpox
@alpox
Oct 28 2017 09:29
@Barkha54 Yea well not there :D
proxy: {
  url: {
    hostname: "..."
  },
  target: "...",
  reqHeaders: (...) => { ... }
}
Barkha54
@Barkha54
Oct 28 2017 09:54
@alpox It is showing the accessing URLs but I'm not getting anything on localhost now.
image.png
Tim Bakker
@ixava
Oct 28 2017 10:07
Hello everyone. I have a problem with PHP and was hoping I could get some help!
$URL_PARAMETERS = preg_split('/\//', $_SERVER['PATH_INFO'], -1, PREG_SPLIT_NO_EMPTY);
if (count($URL_PARAMETERS) !== 2){
  helper\output\json_error("No path parameters for target & method were passed");
}
else{
//   print_r($URL_PARAMETERS);  returns Array ( [0] => user [1] => read )
  [$data_target, $custom_method] = $URL_PARAMETERS;
}
gives Parse error: syntax error, unexpected '='
med abderrahmen drissi
@ra7moun
Oct 28 2017 10:10
hey everyone im new at this,so i developped an app and it was working nicely now i get this when try to login
Tim Bakker
@ixava
Oct 28 2017 10:11
$a = [1,2,3];
[$b, $c, $d] = $a;

print($b . $c);
Works fine, whats wrong here?
med abderrahmen drissi
@ra7moun
Oct 28 2017 10:13
eee.PNG
so this is what i get when i try to login
Cdsapture.PNG
and this the code where i think the fatal error is
please help me
line 23 and 42
any ideas please help
Ajal333
@Ajal333
Oct 28 2017 10:41

$sql="INSERT INTO books(book_n,author_n,genre)
values('".$book_n."','".$author_n."','".$genre."')";
$result_set= mysql_query($sql); while($record = mysql_fetch_array($result_set))
{
echo "<TR>";
echo "<TD>".$record['sl_no']."</TD>";
echo "<TD>".$record['book_n']."</TD>";
echo "<TD>".$record['author_n']."</TD>";
echo "<TD>".$record['genre']."</TD>";
echo "</TR>";
}

Error:Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given.

Sorin Ruse
@sorinr
Oct 28 2017 10:59
@ra7moun think it should be: $e = $select->rowCount() not $select-rowCount(). u need "->"
Marc
@MWBauer
Oct 28 2017 12:51
Cool rainy morning, folks!
How is everyone?
Marc
@MWBauer
Oct 28 2017 12:59
gitter might be broken. I try to scroll up and look at the convos and it goes blank
I could really use some help with my JS on the weather app.
Alexander Køpke
@alexanderkopke
Oct 28 2017 13:23
@MWBauer what seems to be the problem?
Marc
@MWBauer
Oct 28 2017 13:24
well, I stepped away from the images issue for a moment and was playing with the C/F conversions.
Would you agree that to make the conversion, it's not just a matter of reversing the operators, but also reversing the order in which you use the operators?
brb
Alexander Køpke
@alexanderkopke
Oct 28 2017 13:32

Do you mean the conversion formula? I think that can be googled quite easily:

T(°F) = T(°C) × 9/5 + 32
or
T(°F) = T(°C) × 1.8 + 32
Example
Convert 20 degrees Celsius to degrees Fahrenheit:
T(°F) = 20°C × 9/5 + 32 = 68 °F

Alexander Køpke
@alexanderkopke
Oct 28 2017 13:40
anyways you're trying to access the json of the getJSON callback function from outside the callback function. This line var URL = images[json.weather[0].main.toLowerCase()]; it can't access the json variable globally. You can put the code that uses the data from the getJSON request inside the callback function. That would be one way to attempt solving this issue.
Marc
@MWBauer
Oct 28 2017 13:44
back
Sorin Ruse
@sorinr
Oct 28 2017 13:44
@MWBauer i would not call the weather api within the navigator.geolocation.getCurrentPosition(function(position) {} function because if the user does not have enabled geolocation the all app will return nothing as u don't have an alternative "else" statement to if (navigator.geolocation) such as ip location. I would make a new function like getWeather(lat,lon) that will deal with the fcc-weather api. the location function, be it geolocation or ip based, will call getWeather passing the two vars lat and lon
Marc
@MWBauer
Oct 28 2017 13:45
I know the formula, but run the numbers. I was just trying to play with it and I was getting different values
Alexander Køpke
@alexanderkopke
Oct 28 2017 13:45
another way is to make a function and then put the images stuff in then call it from within the callback.
var images = {
    rain:
        "https://www.rd.com/wp-content/uploads/sites/2/2016/09/03-not-weird-facts-rain-Mr_Twister.jpg",
    clear:
        "http://www.zastavki.com/pictures/originals/2014/Nature___Seasons___Spring_Clear_spring_weather_in_the_mountains_067859_.jpg",
    hot:
        "https://media1.popsugar-assets.com/files/thumbor/8-CK1Eb7tMQs9ac_144_cyMd3sg/fit-in/1024x1024/filters:format_auto-!!-:strip_icc-!!-/2013/08/26/907/n/1922441/1d6d0aeeedb3e216_shutterstock_126512999/i/Things-Bring-Warm-Weather-Travel.jpg",
    fall:
        "http://cdn1.sportngin.com/attachments/photo/8528/8183/fall-autumn-red-season_large.jpg",
    fog:
        "https://upload.wikimedia.org/wikipedia/commons/c/ca/Dense_Seattle_Fog.jpg",
    snow:
        "http://static.seattletimes.com/wp-content/uploads/2017/02/02062017_Snow11-1020x680.jpg"
};
if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
        $("#data").html(
            "latitude: " +
                position.coords.latitude +
                "<br>longitude: " +
                position.coords.longitude
        );
        $.getJSON(
            "https://fcc-weather-api.glitch.me/api/current?lat=" +
                position.coords.latitude +
                "&lon=" +
                position.coords.longitude +
                "",
            function(json) {
                $(".message").html(JSON.stringify(json.weather[0]));
                someName(json);
            }
        );
    });
}
function someName(json){
    console.log(json.weather[0].main.toLowerCase())
    var URL = images[json.weather[0].main.toLowerCase()];
$("html").css("background-image", "url(" + URL + ")");
}
like this
Marc
@MWBauer
Oct 28 2017 13:46
I love the sound of everything ya'll are saying, but sadly I'm too new to JSON and get and such to really understand.
Marc
@MWBauer
Oct 28 2017 13:55
what is someName doing?
There are 2 sameName. Are they the same thing? The function defines what happens in the getJSON?
Marc
@MWBauer
Oct 28 2017 14:13
Why do I keep getting an Unexpected end of input?
Ken Haduch
@khaduch
Oct 28 2017 14:49
@sanchitcop19 - I agree with your calling this out as a typo in the article - you should put a comment there to alert the author and see if he responds and fixes it. :point_up: October 28, 2017 1:57 AM
@MWBauer - where are you seeing this error, if you're still seeing it? (You might have fixed it by now...)
Xapuu
@Xapuu
Oct 28 2017 15:00
Hello guys, any React Hero around, i need some help with state management :)
Ken Haduch
@khaduch
Oct 28 2017 15:11
@Xapuu - please post your question, we can try to help...
Xapuu
@Xapuu
Oct 28 2017 15:17

https://pastebin.com/YWeRg6T2

This is the code that needs a fix, in the main component in the will mount component, i want to pass a function that changes the state of the component 'App' in the observer, after that (in the same block ) by accessing the observer, i want to trigger the function, that i had already passed and update the 'App' state @khaduch

sanchitcop19
@sanchitcop19
Oct 28 2017 16:22
@khaduch I'll do that, thanks!
CamperBot
@camperbot
Oct 28 2017 16:22
sanchitcop19 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3423 | @khaduch |http://www.freecodecamp.com/khaduch
kevin
@stormboo
Oct 28 2017 17:28
where is"cat photos"?
Darren
@DarrenfJ
Oct 28 2017 18:24
afternoon fCC
sending out my usual kudos and thanks to the regulars who help out
thanks @khaduch @alexanderkopke @heroiczero @GitHub-Henry @Manish-Giri @thekholm80 @daddycardona @korzo @longnt80 @sjames1958gm
CamperBot
@camperbot
Oct 28 2017 18:26
darrenfj sends brownie points to @khaduch and @alexanderkopke and @heroiczero and @github-henry and @manish-giri and @thekholm80 and @daddycardona and @korzo and @longnt80 and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:cookie: 430 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 3424 | @khaduch |http://www.freecodecamp.com/khaduch
:cookie: 431 | @daddycardona |http://www.freecodecamp.com/daddycardona
:cookie: 621 | @longnt80 |http://www.freecodecamp.com/longnt80
:cookie: 693 | @korzo |http://www.freecodecamp.com/korzo
:star2: 1683 | @alexanderkopke |http://www.freecodecamp.com/alexanderkopke
:star2: 1966 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 1547 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 8626 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 6713 | @manish-giri |http://www.freecodecamp.com/manish-giri
Darren
@DarrenfJ
Oct 28 2017 18:27
@stormboo I think in the exercise they give you the applicable link...
Gustavo Santana
@santanaG
Oct 28 2017 18:28
Is anyone familiar with the GraphQL API from Github?
Darren
@DarrenfJ
Oct 28 2017 18:30
@santanaG sorry Gustavo, I'm not..
have you tried the main fCC room?
Gustavo Santana
@santanaG
Oct 28 2017 18:47
Trying now!
korzo
@korzo
Oct 28 2017 18:48
@DarrenfJ Hi and thanks
CamperBot
@camperbot
Oct 28 2017 18:48
korzo sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2197 | @darrenfj |http://www.freecodecamp.com/darrenfj
Ken Haduch
@khaduch
Oct 28 2017 20:34
@DarrenfJ - thanks to you, too. Keeping the chats alive!
CamperBot
@camperbot
Oct 28 2017 20:34
khaduch sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2198 | @darrenfj |http://www.freecodecamp.com/darrenfj
Ken Haduch
@khaduch
Oct 28 2017 21:06
@Xapuu - I had to leave the computer for an extended period. Did you get help on your problem?
Xapuu
@Xapuu
Oct 28 2017 21:07
@khaduch yes, i got the help i needed, i didnt knew that setState is async func, and that messed my code a lot :D, thanks for the response
CamperBot
@camperbot
Oct 28 2017 21:07
xapuu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3425 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Oct 28 2017 21:08
@Xapuu - okay, great!
David Chen
@Obiwan777
Oct 28 2017 21:20

Hello room.
quick question for php syntax check here
my code is below

if(isset($_REQUEST['phrase'])){
    $queryBook = $_REQUEST['phrase'];


    $queryThree = "SELECT * FROM kjv WHERE bname LIKE '%$queryBook%'";
    $prepareThree = $dbObject->prepare($queryThree);    
    if(!$prepareThree)    {
        print("Prepare failed: (" . $dbObject->errno . ") " . $dbObject->error);
    }
    $countOne = $prepareThree->num_rows;
    $prepareThree->bind_param("s",$queryBook);
    if (!($prepareThree->execute())) {
        print "Execute failed: (" . $dbObject->errno . ") " . $dbObject->error;
    }
    $prepareThree->bind_result($bname,$bsect,$bnum,$cnum,$vnum,$vtext);

    if ($countOne == 0){
        $outputOne = 'There was no search result!';
    }else{
        while($rowOne = $prepareThree->fetch()){
            $bookName = $rowOne['bname'];
            $bookSection = $rowOne['bsect'];
            $bookNumber = $rowOne['bnum'];
            $chapterNumber = $rowOne['cnum'];
            $volumnNumber = $rowOne['vnum'];
            $volumnText = $rowOne['vtext'];

            $outputOne .= "<h2>$bookSection,$bookName,$bookNumber,$chapterNumber,$volumnNumber</h2>
            $volumnText<br /><br />";
        }
    }

the result is always outputting "there was no search result"
and SELECT * FROM kjv WHERE bname LIKE '%$queryBook%'; works in database
anyone see any error I might have above.
using OO instead of precedure
thanks

gishy1
@gishy1
Oct 28 2017 21:25
image.png
@khaduch have a second look this is doing my head in
Ken Haduch
@khaduch
Oct 28 2017 21:31
@gishy1 - first thing - if ( b <= num ) - that is, string length and truncated length comparison says that you don't need to truncate, then just return the string. If you make that condition first, and that's the route it goes, then you don't have to check that again, you'll know that num is less than b. So you can concentrate on figuring out how much truncation to do.
gishy1
@gishy1
Oct 28 2017 21:33
image.png
ya have a second look @khaduch
Ken Haduch
@khaduch
Oct 28 2017 21:37
@gishy1 - after that, if b is greater than three, then you want to truncate the string using a length ( in other words, an adjusted num value ) of num - 3, because then you add the ... to the string to give a final length of num for the string that you return.
The last thing is if b is less than or equal to three, you just truncate the string to that length, and append the .... That's like the cases that are the last two in the test list.
korzo
@korzo
Oct 28 2017 21:44
@Obiwan777 because $countOne = $prepareThree->num_rows; is before $prepareThree->execute()
Victor Abeledo
@victorja
Oct 28 2017 21:47
Guys do you know why I'm getting "ReferenceError: date is not defined
at Movie.play"
https://jsfiddle.net/d28zk2av/
Should I create a new Date object on every method of the class?
Ken Haduch
@khaduch
Oct 28 2017 21:56

@gishy1 - I'll have to retype your code because you have just posted an image, but you would be able to simplify your code (at least my view is that this is simpler) to do this:

var b = str.length;
if ( b <= num ) {
    return str;
}
// at this point, if you haven't returned you don't have to test the
// relationship between b and num anymore - you know that 
// you have to do the truncation and append the "..."

// the end result of what you want to do is this:
// return str.slice(0, adjustedNum) + '...';

// figure out how much you need to truncate the string, and
// start with the value that is in num
var adjustedNum = num;
if (num > 4) adjustedNum -= 3;
return str.slice(0, adjustedNum) + '...';

I just used a new variable adjustedNum to make it clear that the value might be different, based on the requirements of the exercise.

You can use your technique of generating the different possible strings and then selecting the one to return, but I think that the approach I showed is a little simpler.

(And I have to go offline for a while - I hope that helps... )

Henry
@GitHub-Henry
Oct 28 2017 22:19
@DarrenfJ hello & thank you
CamperBot
@camperbot
Oct 28 2017 22:19
github-henry sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2199 | @darrenfj |http://www.freecodecamp.com/darrenfj
David Chen
@Obiwan777
Oct 28 2017 22:20
@korzo I moved it to the next line after bind_result, its still showing "there was no search result"
korzo
@korzo
Oct 28 2017 22:23
@Obiwan777 As far as I can tell,there is no num_rows property in PDOStatement
David Chen
@Obiwan777
Oct 28 2017 22:24
@korzo what should I replace it then?
korzo
@korzo
Oct 28 2017 22:30
@Obiwan777 oh, I thought it's PDO, not mysqli
korzo
@korzo
Oct 28 2017 22:39
I didn't use mysqli for ages.
try this http://php.net/manual/en/mysqli-result.num-rows.php#105289
@Obiwan777