I have 1 table and it having value as http:\\www.google.co.in and I am quering this sql query SELECT * FROM tbl_url WHERE url = 'http:\\www.google.co.in' but it gives 0 rows
I'm creating a json array from MySql data using concat like this:
$id = '5705';
$sql = 'select concat("{""type:""colName"",""id"":""$id""}") as myJson from table where etc.;
$stmt = $conn->prepare($sql);
What's happening is, instead of getting data from colName from the table and the value of...
teresko: actually, it was my fault (which makes more sense), but I'm having trouble decoding the JSON. It has " which is being read wrong by json_decode.
@Gordon Sounds pretty awesome! I'd love to see an Eric Clepton concert. I don't know what Finca is, but assuming I can trust Wikipedia that seems pretty fun and relaxing too.
@PeeHaa埽 The problem is (but it's getting better!) that people don't separate concerns at all. It sounds like the same problem php was (is?) having with people mixing their presentation with business logic in templates.
@BenjaminGruenbaum I do agree that people don't separate their concerns correctly, but saying that is the problem when suggesting jquery while OP is asking a question about PHP/MySQL is just stupidness :)
@ShadyAbdAlrahim Rep Whoring is done by answering easy questions that you know that were answered before a million times, and yet you answer for the easy rep
It's frowned upon when the "offender" is a high rep user
Anonymous
@ShadyAbdAlrahim It is subjective. If you are always keep looking for too easy/ too localized questions, and you keep answering them, that would make it rep whoring, however if you sympathize with nebiew and just keep extending a hand, it is perfectly ok with me.
@MadaraUchiha i work with HTML, CSS, Jscript (not professional at it), want to learn JQuery, Ajax, and i'm good with PHP not the PDO one the regular one
@MadaraUchiha yeah i watch people using new syntax and new semantics in php with something called PDO, which i haven't worked with at all, yet i have worked with the common php that people use..
@ShadyAbdAlrahim I was like you,(if not worse) when I joined SO. In-fact, So noob, that I did not know the difference between apache/mysql/php. But, all of these good people taught me so much in an incredibly short time. If you stick around in this room, you'll learn a lot.
First 3 chapters are a must, I recommend you read everything in there
It's really light reading and well focused
Anonymous
@MadaraUchiha Same here. Did you hear about my latest adventure? I am ditched apache + shared hosting, and started hosting on VPS server, with CentOs, running Nginx doing yum from putty. And, I got all this idea from @DaveRandom in this room.
You make changes to your code, save, commit your changes to Git, and Git can generate a history of commits for you, in a way that you never lose anything.
Also, Git is awesome for teamwork, you can create branches for different features etc.
Please read the link I gave you
You can finish the whole thing in an hour or two, and it's very informative
same here. That is why, I am still refusing to learn jQuery, even though I have tons of tutorials in my PC. I like to learn and excel with Js and Ajax before moving to jQuery. Then learning will be a piece of cake.
I have a secure persistent login feature using cookies
Anonymous
@MadaraUchiha Well, I will surely move to jQuery, but still would love how things work without having to rely on jQuery. It is not that I don't believe in the awesomeness of jQuery, just trying to learn more I guess.
Using the popular jQuery library for JavaScript, you could do that like this:
var select = $('<select name="drop1" id="Select1">' +
'<option value="volvo">Volvo</option>' +
'<option value="saab">Saab</option>' +
'<option value="mercedes">Mercedes</option>' +
'<option v...
@bwoebi Yeah, great idea, let's include 80 friggin kilobytes of code just to perform var ajax = function(url,callback){ var a = new XMLHttpRequest();a.open(url,"GET");a.onreadystatechange = function(){ if(a.readyState === 4 && a.statu === 200){ callback(a.responseText);}};};
the persistent login thing is secure enough and being used anyway, I just don't see the need to check that and then start a session which is just another vulnerability...
@phpNoOBఠ_ఠ You clearly have no understanding on how any of those work. AJAX is just an HTTP request that doesn't require a page refresh, it's just like a normal page entry only you invoke it with code, read on how the HTTP protocol works. Socket.io is a library that uses technologies like WebSockets (and AJAX if it needs to) to do duplex communication. Node.JS is server side JavaScript and XMPP is just a messaging protocol.
@MadaraUchiha Well there's also one more way. When user logs in with different ip than used to, you can send notification and ask for verification. But it's very very very uncomfortable.
kinda complicated, but basically, user enters credentials first time, generate two long random numbers and store them in the db with the user name and in the cookie. User comes back to the site - get user/number1 from the cookie, pull that record from the db, now compare number2 from that record with number2 from the cookie
And the article does not explain it well enough for you and you still have questions or concernes or what?
Anonymous
@BenjaminGruenbaum I beg to differ. I am sure if you were trying to create a chat website, you would prefer to use Node.js/websocket.io/XMPP instead of using AJAX. that is what I meant, nothing more/less
I'm just asking why in the world I should use my secure cookie to set a session variable (another vulnerability) rather than just checking my cookie/db every page load and setting $auth = true. The only drawback I see there is performance.
but everyone is saying it's not secure.
I can't see that. That says to me that persistent login is totally un-secure no matter what you do.