hericles 289 Master Poster Featured Poster

Simply include the username is the result from the login query against the database. Then store it in session, or whatever persistance option is available to you. Then you have it available to use whenever you need.

hericles 289 Master Poster Featured Poster

Firstly, I'd check that the is_dir command is workinf correctly. Which folder are you running the script from? I doubt '/xampp/htdocs/image' is relative to where the script is running and it isn't an absolute path.
Add more echos to ascertain which code is running and where it stops. At least that way you'll be able to narrow down where the proble is.

hericles 289 Master Poster Featured Poster

Follow through each step and make sure everything is as expected. So check $_POST['password'] holds a value, check that password_hash() doesn't return FALSE and check the error message from your db call.
Everything looks fine from a cod epoint of value.

hericles 289 Master Poster Featured Poster

I don't see whre you're selecting the old password for the user, other than this:
$chg_pwd=mysqli_query($link, "select account_number,password from Login");

And that doesn't get the details for the particular user which makes me think you're just retrieving the first user each time.

hericles 289 Master Poster Featured Poster

Trying running
npm rebuild node-sass

It should help rebuild the correct binding for your setup.

hericles 289 Master Poster Featured Poster

You're passing your comment string into the .comment-info div as text. You need it to render as HTML so instead try:
$(".comment-info").html(comment);

hericles 289 Master Poster Featured Poster

I've never been too fond of Android Studio. I use Visual Studio Code for anything Angular now and love it. But it really comes down to a couple of things: does the editor have the features I need to get the job done and do I like using it? If you say yes to both, use it.

For any Angular/Ionic project you can go into the root folder and run the command to send it to the browser, using either 'ionic cordova ...' or 'npm ....' for whichever way you initially set it up.

hericles 289 Master Poster Featured Poster

Hello,
First up, no Java needed at all. Angular is based in TypeScript now which has a very similar structure to JavaScript. If you don't know Javascript that well, it's easy to pick up.
Using Ionic will mainly come down to running some commands on the CLI to build, deploy, that kind of thing plus, possibly using some of the Ionic controls in your HTML.
They are very compatible with iOS but you should probably understand the difference between how Ionic compiles an app (essentially into a webview inside an app container) vs other options that result in native code (Xamarin for example).
Also, some other frameworks (ReactJS, Vue, etc) seem to have a performance advantage over Angular. I've built several apps using Angular 1 through4 now and have found the perfomance to be perfectly acceptable but not lightning fast.

hope that helps.

hericles 289 Master Poster Featured Poster

The error is quite clear. You're passing a string into a dictionary that is declared to accept BetGuns.Web.Models.Home.VM_HotGames.
You just need to look at the line causing the error and pass in a variable of the correct type.

ddanbe commented: Nice answer +15
hericles 289 Master Poster Featured Poster

The only thing that can be going wrong is that the ID is getting misread when looping through an array with a single value. It is always reading the ID of the first row regardless which checkbox was actually checked.
You'll need to do some debugging to figure exactly why that is happening but I'd start with looking at the POST variables going to the update script. That should show you the way forward.

hericles 289 Master Poster Featured Poster

Good to hear.
For clarification for any others that find this, the initial code was an if statement without an elseif.
$camp['CampaignStatus'] < 2 ? 'Drafted'

It was incomplete as it asked

if ($camp['CampaignStatus']  < 2 ) {
        return 'Drafted';
} else if() {

}

which won't compile in any language.

diafol commented: Always good to see an explanation for the benefit of others. +1 +15
hericles 289 Master Poster Featured Poster

Any chance you could simply add the error message to the post rather than have us download a file?
And Win7 with SQL Server 2005? Why so out of date?

rproffitt commented: Good question. If a company waits too long, they can't find folk to work on the products. +12
hericles 289 Master Poster Featured Poster

You're missing your second option in the second ternary operator:

($camp['CampaignStatus'] < 2 ? 'Drafted' : <SHOULD BE SOMETHING HERE> )

hericles 289 Master Poster Featured Poster

You're not giving the option a value so no data is getting passed back in the POST for that variable.

You need to chnage this:
echo '<option value>' .$row['paramhead']. '</option>';

to:
echo '<option value="' . $row['paramhead'] . '">' .$row['paramhead']. '</option>';

hericles 289 Master Poster Featured Poster

You could consider a notepad++ style interface (but prettier) with vastly reduced functionality from, say, VS but the compilers and ability to compile the project and output the result would be an absolute minimum.
And remember you'd need to be able to deal with projects rather than individual files to be useful.
As a minimum you'd probably want to include:
Create project
Create file
Save
Find and replace
Building
Compiling
Error reporting
Intelli-sense would be nice but not strictly necessary for the project you're considering

hericles 289 Master Poster Featured Poster

Are you looking for something that can parse and convert your CSV file automatically or are you happy doing the coding yourself i.e. writing the code for highcharts?
If the former, then your options maybe limited. If the latter, then, sure, you can style the heck out of it and come up with an awesome result.

Simply turning your CSV into a table won't get you far, switching it to JSON will make it easier to work with if you do intend to script the actual graphs yourself.

hericles 289 Master Poster Featured Poster

Bounce rates are generally high, although the type of website makes a big difference e.g. bounce rates for blogs are higher than normal.
If you're bouncing at 65% or over you probably have an issue. Some experts say a bounce rate of 25-45% is pretty good.
How to reduce the bounce depends on a variety of things but how and where you're marketing the site would be major contributors.

A bounce is almost always because the initial content the user see doesn't match what they were looking for so is your search engine blurb or ad accurate to your content?
Do you make the content of the page easily identifable?

You may need to alter your landng pages to better keep visitors or work on your ad words and marketing channels so the users seeing are your ads and links are already the right market segment for your site.

hericles 289 Master Poster Featured Poster

I'd consider using Unity. It's cross platform and you'd be programming in C# which is much better than trying to get to grips with C++ if you haven't used it before.
C++ has advantages over speed of performance but C# will be faster to write in and makes a perfectly good final product.
Either way, I always suggest it-ebooks.info and find what you need there - it has a huge range of free books.

hericles 289 Master Poster Featured Poster

And May to July is all of the data contained in the database?
When you say it returned the header only are you referring to the first row in the file i.e. just the headings? It could be that you're parameters don't match the format in the date columns and therefore nothing is returned.
Can you echo out the select statement and paste it here?

hericles 289 Master Poster Featured Poster

Are you saying the first one works but the second one doesn't?

The second will export all dates because you the comment delimiter inserted:
SELECT infotbl.barcodeid, tbltime.barcodeid, infotbl.fname, infotbl.lname,infotbl.jposition, tbltime.rectime, tbltime.recdate FROM infotbl INNER JOIN tbltime ON infotbl.barcodeid = tbltime.barcodeid -- WHERE recdate = :frdate AND recdate = :todate"`

The WHERE part of the command will be ignored because of the --

hericles 289 Master Poster Featured Poster

I think you need a better design to do what you want.
For a start referring to the amount's by the ID when the ID is a number is immediately confusing. A + b + C makes far more sense.
But, regardless, stripping the equation apart to insert the values from the other table is always goingt o be tricky.

Can you pull the values and equation from the db and then do your transformation in code instead?

hericles 289 Master Poster Featured Poster

You can just concatenate the current column value with the new input.
UPDATE table_name SET col1 = CONCAT(col1, 'new value') WHERE ID = some_id;

hericles 289 Master Poster Featured Poster

How many settlement records are there for 'Kapoor'?

සශික commented: more than two +1
hericles 289 Master Poster Featured Poster
SELECT blabla
FROM a INNER JOIN b ON a.a = b.b
ORDER BY a.id DESC LIMIT 10;

If you're creating the SQL statement in code just replace the 10 with whatever the result of (variable x 10) is.

hericles 289 Master Poster Featured Poster

I would guess it is because you're not actually stopping the button submission by return false; or event.stopPropagation() so your form is still submitting sometimes. All the cancel button does is close the window but you've still clicked the submit button before that.
Why it only happens sometimes, I don't know, probably a matter of timing before the window closes.

hericles 289 Master Poster Featured Poster

It looks to me like your doing some extra steps when getting the salt and password out of the database.
When creating the password you create a salt, add it to the password and hash the combined string. The salt and hashed password then get saved to the database.

On signing in you retrieve the salt and hashed password but you shouldn't need to do anything to the hashed password. Add the salt to the provided password, hash it and then compare that to the hashed password in the database. If they match you're in.

hericles 289 Master Poster Featured Poster

If you're getting the results back via JSON and then adding each to the page why can't you add a jQuery .click function to each one at the same time?
$('.flex-1').click(function() {});
Then, when a .flex-1 is clicked, the this keyword will target the clicked element only.

hericles 289 Master Poster Featured Poster

Firstly, this line only showing one row:
$result = mysqli_fetch_row($result);
var_dump($result);

You've only asked it to fetch one row so the dump only has one row. mysqli_fetch_row does just what it says i.e. it returns ONE row.
For the second problem, the var_dump of your row above shows what's wrong there. 'name' isn't a key in the array, everything is index based.
echo $row[1]; // will outut the name column

hericles 289 Master Poster Featured Poster

hericles , there still a problem

I'm going to need more information than that. If you run the code what error do you get?

hericles 289 Master Poster Featured Poster

You need to put quotes around the value for the Location column.

SELECT * FROM kladilnica WHERE Location = 'Macedonia' AND Uplata = 50 AND Liked = 50

So you need this:
if($selectCountryBox != "") $searchArr[] = "Location = '{$selectCountryBox}'";

hericles 289 Master Poster Featured Poster

You may be onto something.
I read these polls that say he rates low with women in the Republican Party and a majority of men don't like him either yet he still wins state after state for the nomination.
I don't profess to understand American politics at all, this drawn out horse race just to decide who gets to run for each party is nuts, but from what I've read only about 20% of the Repubican Party get to vote for the nominee so maybe it's has been skewed in some way?

I refuse to belief that the majority of Americans want this idiot in charge. He shows the most despicable traits: narcissism, arrogance, bullying, xenophobia, racism, sexism, constantly lying (badly) - who can take him seriously?

face1m commented: Those despicable traits are what the people "LOVE" about him. However, don't forget about the evangelicals who worship him has their savior. +0
hericles 289 Master Poster Featured Poster

From their documentation page:

The default math delimiters are $$...$$ and [...] for displayed mathematics, and (...) for in-line mathematics.

FYI: The text editor here stripped out the \'s from the quote.
The displayed mathematics, your syntax 2, are designed to break the equation out of the page and display it bigger, brighter, better.
The in-line is designed to include the equation in the current line of text, hence using the default text size for a line of text on the page.

If you wanted to use syntax 1 you would need to include some CSS:
And the equation for that is: <span style="font-size: 32px;">\(x={72^2-{\sqrt{53^2}}\over 25}\)</span>

hericles 289 Master Poster Featured Poster

Your SQL looks right so there must be so external factor happening, some form of permissions being the ikely problem (yes, I now you said the directory was 777). Are you checking the MySql error after you've ran the query?

hericles 289 Master Poster Featured Poster

Unfortunately, I think the answer is no. Humans are incapable of functioning in sufficiently large groups with leadership/authority in place.
You state the government is the worst organised crime but it isn't that simple. It takes organised effort to a variety of good things like food distribution, infratructure, health care, etc. Sure, governments can be (and are) corrupt, or more exactly, are full of corrupt people.
As Plato said, power should be given to those that least want it. A government staffed by truely alturistic, intelligent people wouldn't be a bad thing.

You gave an example:
"Another example: You mom calls you sick and sounding really in trouble, you get your car and go the fastest you can to her... but the fastest you can is not always allowed by the government. So you could actually be stopped by the police and even go to jail because you're trying to reach your mother."
It's not the best example because if your mum really is in trouble you aren't the best person to help her. Either she needs the police and/or and ambulance (if only because they can get there faster/safer) or her problem isn't so severe that you need to drive at dangerous speeds, endangering innocent people around you.

Your rights stop when they could, even just potentially, harm others.

"Anarchism is free people contributing with free people to do what they judge best for them selves, their family and their friends."
And that, also …

hericles 289 Master Poster Featured Poster

It is possible. What you will want to do is use jQuery and monitor the onchange event of the drop down so your code knows when an option has been selected.
Then you do an http.post to the server with the selected option as the data. Your PHP endpoint will read the data (the user ID) and select the relevant data from the database and return it to the jQuery post which will then display the results on screen.

You can do the same thing purely in PHP but you would need to have a page postback (form submit) for server to know which option was selected.

hericles 289 Master Poster Featured Poster

Are you trying to send an email that has all of the items in it?
If yes, alter your query to return all rows (i.e. all relevant items) and run through each row, parsing the data, and adding it onto the body string.
I'd switch to using a DataAdaptor and a DataTable for that (my personal preference) and process over them all.
You'll want to alter your HTML generated string to style the results better of course.

hericles 289 Master Poster Featured Poster

A web service is a piece of software, running on the server (computer B) and listening on a particular port (optional).
Computer A would post data to the URL and port the web service is listening on and it will be processed on computer B.

You can post information to a URL with particularly ever programming language (.Net, cURL, PHP, javascript, the list goes on) and all server side languages should be able to create a web service to listen on a port. So you can definitely do what you want with WCF or a variety of RESTful architectures.

The error you are getting is almost certainly because you haven't set up an endpoint or the endpoint is wrong and isn't aimed at the connector's location.

hericles 289 Master Poster Featured Poster

You can do AJAX calls on every key up event if you want it to be that responsive, that'll send a request to the server for partial amounts as well because it won't know when the user has finished typing.
Or you can call when the input uses focus if that is relevant.

hericles 289 Master Poster Featured Poster

What is students_lab10? As the error states, it isn't defined in your code. The first time it appears is when you are trying to use it.

jodytj commented: Thank you, now I am getting other errors when selecting 1 in the menu +0
hericles 289 Master Poster Featured Poster

Mailchimp.

hericles 289 Master Poster Featured Poster

What exactly are you stuck on? You haven't told us what you're trying to do.

hericles 289 Master Poster Featured Poster

And it won't. onclick is used to specify which javascript function is called when an element is clicked.
You would need a matching javascript function to go with that on click:
function someFunction() {}
Given that you want to redirect you would then have the window.location.href command in there.

But, given that that is all it appears you want to do, use a <a href="administrators_form.php"> tag instead and style to look like a button.

hericles 289 Master Poster Featured Poster

A button isn't a link, the href attribute has no effect. If you want to redirect to the admin page either style an <a> tag to look like a button or add an onclick event to the button so some javascript can process the redirect.

hericles 289 Master Poster Featured Poster

It works fine for me with the id added. The validate will never fire as you have it though as you are submitting the form in the onchange event of the select. Meaning you don't get to select 2 or 3 and then click next.
You'll want to call it from inside the onchange if you want to post the form when the user selects an option. Or move the submit to the validate function.

slowlearner2010 commented: yeah it work fine by the way. there a mistake on my code that make this func not working properly..thanks a lots +0
hericles 289 Master Poster Featured Poster

Most obvious problem is you are using getElementById but your form doesn't have an id attribute.
The code for setting the action looks right except it isn't affecting anything because the form can't be found.

slowlearner2010 commented: thanks for your answer. its solved now.. +2
hericles 289 Master Poster Featured Poster

You could have spent a few minutes reading up on the fetchAll() method. Hint: it returns an array.

$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
now loop through each row in the $result array, getting the Consumption value

foreach($result as $row) {
    $c = $row['Consumption'];
}
hericles 289 Master Poster Featured Poster

Head over to https://it-ebooks.info/tag/programming/ and browse around, also go to https://www.packtpub.com/ and sign up. They give away a free ebook every day (the quality varies).
In terms of what to learn, if you don't have a particular language but want to become a better programmer, I'd look at the books that discuss data structures and algorithms. SQL knowledge and databases is always good, concurrency, things like that.
There were some books called code complete (I think), came in 2 volumes, that broke down good coding style with plenty of examples. They were pretty useful but I doubt you'll find them on the link above .

hericles 289 Master Poster Featured Poster

Look into jquery http.post method. It lets you make an AJAX call to a URL you specify and pass in data.
The PHP script reads in the $_POST variables and you're all set to do your database query

hericles 289 Master Poster Featured Poster

To defend against SQL injections make sure you're using prepare() for all of your database queries.

hericles 289 Master Poster Featured Poster

If you are only pulling through the name and subject initially (and ID presumably) then when the preview is clicked on you do another database query to get the rest of the message information using the ID as the identifier. And then display that in the seond area in pretty much the same way you displayed the preview.