« first day (665 days earlier)      last day (4510 days later) » 

19:00
Would this be proper MySQL syntax or no? I'm trying to select everything from assignments and grading, they're both tables.
SELECT * FROM `assignments`,`grading`
Haven't done something like this before, so I thought I should ask.
@Alec No
You want to look at SQL Joins
@Charles Thank you, I was basically doing this myself mentally but I had to come up with it myself. Probably a good reason why I was so confused on how I was going to do my database management.
how to print this array in tabular format
i am new with php
Hi all
i just wanted to discuss that
some websites that recomend to use IE why is it so? its not that they are third class websites they include some government level websites as well as my standard charted bank
is there any specific reason
@hookman
    function array_search_recursive($needle, array $haystack, $strict = false, &$map = []) {
        foreach ($haystack as $key => $value) {
            if (is_array($value) && array_search_recursive($needle, $value, $strict, $map)) {
                $map[] = $key;
                return true;
            }
            if ($strict && ($needle === $value)) {
                $map[] = $key;
                return true;
            }
            if (!$strict && ($needle == $value)) {
                $map[] = $key;
19:14
@rahularyansharma ns1.cheatad.com returned (SERVFAIL)
ns2.cheatad.com returned (SERVFAIL)
Can't really visit your page if it's not accessible.
wait 2 min
i am checking what happened there
my bad luck .....i am trying to upload that file again with some changes and now server is not connecting
Yes your name servers appear to be down.
@Alec thanks for your effort ...i am trying to solve this as soon as possible
will be back
PDO and user-defined column names for ORDER BY clause. How is this done?
I've not found a satisfactory / working answer to this problem.
Anyways, for your tabular format you wish I would reccomend using <span> HTML tags attatched to CSS to format it as a square.
If that's what you're talking about.
19:19
@Bracketworks awesome
its working now
@Alec please check now
@rahularyansharma Is this being retrieved from MySQL?
@Alec that all data coming from api in json format and i use the
$array = json_decode($json, true);

print_r ($array);
on this page
Oh snap, I don't have any experience with that kinda stuff. I'm a rather big newbie. Sorry, I thought you were retrieving from MySQL.
now i wants to show only hotel array but i am not getting the way to filter arrays , as its seems there are multiple array
@Alec ok no problem , any one experienced in json to array
any one experienced in json to array , liitle bit complex structure
19:29
@rahularyansharma what exactply do you want to print?
@rahularyansharma Just noticed something on the bottom of your page you might want to look at if you haven't. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sayhotel/public_html/rahul/search.php on line 41
i want to print hotel data
@rahularyansharma as a table?
yes
like you want to check you can check here
search here for any city
you will get idea what exactly i want to do with this json response by converting it into php array
here you can see the hotel list
i have the same data
and i want to print my data as they did
on my page
in second line there is an array start
HotelSummary
@hookman yes
i want to
$hotels = $array['HotelListResponse']['HotelList']['HotelSummary'];

$result = '<table><tr><th>Hotel name</th><th>City</th><th>Postal code</th></tr>';
foreach ($hotels as $hotel) {
    $result .= '<tr><td>' . $hotel['name'] . '</td><td>' . $hotel['city'] . '</td><td>' . $hotel['postalCode'] . '</td></tr>';
}
$result .= '</table>';

echo $result;
@rahularyansharma did you get the idea?
of the code above*
19:42
@hookman thanks man
@rahularyansharma you are welcome
@hookman $hotels = $array['HotelListResponse']['HotelList']['HotelSummary'];
will you explain this me
as i am new with php
@rahularyansharma Are you new with programming?
no i am new with php , i am exprieced in c#
@rahularyansharma this does basically the same thing in PHP and C#
19:49
in c# i have used list , i never worked there with
@rahularyansharma via [key][key][key] you are navigating through the multidimentional array
@rahularyansharma arrays
@rahularyansharma arrays are a programming concept, not a php concept. search online to learn what an array is, then ask questions here. don't search here to learn what an array is.
@hookman thanks , i am getting ideas about array now. thanks
@Nile ok , thanks for suggestion
19:50
@rahularyansharma gl
Any ideas? There's data in the database but it doesn't seem to be grabbing it.
@Nile i never understand why people become so rude so early
The bottom is the result.
@Alec thanks , hookman solved my problem
@rahularyansharma It's all about your introduction and background. If you're experienced with C#, then you really should know how to search google and learn about new concepts. If you were to tell me that you've never learned any programming language before, I may be kinda as you'd probably not even know what to search google for. But with such a basic concept, an "experienced" C# programmer should know where to go.
19:54
@Nile i already search on google how to read array in php and there all examples with one dimesional array
thats why i come here
@rahularyansharma you must've not searched well enough. first result on google: php.net/manual/en/language.types.array.php
@rlemon 10/10
And would anyone mind looking at my question I just submitted above? I think it was accidentally passed over.
user image
3
^ awesome!
runs away
@Alec is queryDB a custom function?
19:59
@Nile Yes. It's a little messy method of mine since I'm a lazy guy.
function queryDB($q) {
	$db = mysqli_connect('localhost','nournotgettingthis','nournotgettingthis','nournotgettingthis');
	$query = "$q";
	$res = $db->query($query);
	return $res;
}
> nournotgettingthis
lol
@Alec This is not good. You're making a database connection for every query
@alec i got a few questions
/me buys a new router because Windows can't connect, Linux can't connect now #fml
@Charles I wouldn't imagine that would be too intensive.
20:00
@Alec 1) why are you connecting every time you make a query? 2) why are you putting double quotes around $q in your definition of $query, 3) why aren't you using prepare statements?
@Alec You would imagine incorrectly
@Nile Because I'm a newbie who hasn't moved onto PDO yet, and because it's function arguments. Those quotes don't transfer over. I'm pretty sure, since I call my other things that way and they work fine.
okay, fix the connection problem first.
Could I just call MySQL connect once in a file that's included, and never have to connect again throughout my entire code?
is something like <?php echo '<div style="margin-left:rand(1,4)em"></div>?> or something like that possible?
20:03
@blackbee yeah
@Alec yeah
is the syntax alryt? @Nile
@blackbee You dont have any ending '
@blackbee no, but this should be: <?php echo '<div style="margin-left:'.rand(1,4).'em;"></div>'; ?>
thanks
@blackbee np.
20:06
@webarto Where are you located? Is getting a wired connection a problem?
@Nile I got this when I commented out $db and only put it on the top of the page just before the <?php. Fatal error: Call to a member function query() on a non-object in /home2/pinkfluf/public_html/dv0nx/functions.php on line 15
Line 15 is
	$res = $db->query($query);
yeah.
May sound sad but I'm confused on what to do.
change: function queryDB($q) { to function queryDB($db, $q) {
and your function call from queryDB($query) to queryDB($db, $query)
Wouldn't that still be reconnecting for every query?
Since $db has the mysqli_connect stuff?
20:09
it's more like driving over a bridge every time vs. reconstructing the bridge and then driving over it every time
ok my second problem is when an user comments on a postby other user. the page refresh and then the user ends up at the top of the webpage
@Nile So it's not taking care of the connecting every time I call the function issue?
is there a php way to bring him automaticaaly back to where he was befor posting the comment
@hookman Serbia... just plugged in cable and it's working like it used to... when using wireless, something like "Network service discovery disabled. Your current network has a .local domain" showed up, no internet, no LAN... I bought some ASUS router that I had trouble to even configure, previous was DLink but I got constant timeouts... thanks ol' chap
@blackbee where do you want them to end up? the easiest way to do this is give the comment div a name of its ID from the database, then send the user to URL#{$id}
20:12
dats sound perfect
@Alec it's using it as a bridge every time you use the $db variable. think of it like this: would you rather login to your email every time you wanted to open an email, send an email, close an email, etc... or would you rather rely on the first time you logged in, keeping that as the bridge
@Nile Alright. And what do I put in the query when I call the function? I have two files. functions.php which has my preset functions, and main.php that does everything else.
btw that php code is not giving the result
what is wantted was each squarebox containing a post and comments to be positioned randomly....
@Alec you put your query? I'm not sure I understand what you mean.
@blackbee can you upload what you have to pastebin.com or ideone.com
no i think i made it...... u were ryt i ws wrong
20:16
@blackbee alright
but in the result.. instead of being random it looks like a descending staircase.. this is not what i wnt
@blackbee is the staircase random though?
(the lengths between the descending staircase)
@blackbee it's probably a css issue that's not my fault. do you have a link?
no its 500 lines of code i am trying to wirte a sample of the part where i want it....
btw i tried to do with wookmark and blocksit but i failed
20:21
@Nile Alright, I fixed it to how you want it. Still not receiving any data with the previous problem I stated.
@Alec pastebin for me? xD (btw - i've never used mysqli before so :/)
@Nile Do you have a Skype or something I can add you on? I don't want everyone seeing the source.
you can email me, jfein.net
 sudo rm /var/run/avahi-daemon/disabled-for-unicast-local
@hookman does the trick
i mean the code is something like this:
echo '<div style="margin-left:'.rand(1,4).'em;">';
echo '<div class="postbox"><p>';
echo '<font colour="green">Blackbee</font><br/>':
echo 'this is a test<br/>';
echo"\t alex said : u failed the test.<br/>";
echo '</div>';
suppose this is a sample box; let us assume there are 6 such boxes can be arrange it random with php.?? any mathematcial calulations??
the css3 is not supported by some old versions of web browser
plus i am getting a liittle lazy coz my website is 3/4 th finished..
20:28
@webarto Never had a chance to use a router, but I feel it will be pain in ass. (I'm buying a tablet)
inwebson.com/demo/blocksit-js/demo2 @Nile here u see there are multiple colums, i can afford at most 2 columns...
@blackbee i'm not sure, though it seems like an html/css problem. sorry
@hookman serverfault.com/questions/408263/… (I'm getting boring with this link)... I bought some cheap DLink (about $20), I was like, router is router... my ass... I bought a $100 one today, had some troubles because it is more advanced (which is good I guess)... it is very good if it's working :)
@Nile Alright check your email.
20:32
@webarto always wanted to master GNU/Linux... But unfortunately there are too many things I want to master. Git is next.
If you're wondering what zerobin is, it's just a AES-256 bit encrypted variant of pastebin basically.
can you detail me on providing a url{#id} for each post..... i can understand it but dont know how to do it
do you know about the # trick where typing #name will take you to the element with a name of "name"
@hookman I use LAMP for work (just one application on entire computer), and what I build there, must 100% work on server, because they are pretty much identical... I use Windows for other apps, since it's harder to mess up things, and I can experiment... I used official fancy Github for Windows, and returned to CLI... I don't think they can make GUI that powerful...
20:34
@alec I got it
@Nile the trick?
@webarto I do not want GUI.
@Nile Basically I'm working on making a school record management system for some spare dough, I'm saving up for my first car so yeah.
@webarto I do not want win console either
20:36
@hookman just wanted to say, don't even think about it... it's command prompt in Windows :) CLI is referred to Linux usually...
@webarto I didn't)
@Alec if this function works everywhere else but the one place, then I'm not sure why this is happening. does the function work everywhere else
@Nile Yes
@webarto I came across some articles mentioning the win software for windows
@Alec then I'm not sure at all. it could be the query().
20:39
@webarto Honestly, the problem is time, not the software search.
All I have to say, is that if this works, #awesome
@blackbee: give a div a name of "blahblah" on a long page that scrolls. then visit that page URL and at the end put: #blahblah. your browser will automatically scroll down to that div
i got it from the link u gave me.....
@ircmaxell dat wat? :)))
I'm doing a proof of concept
and if it works, holy crap
20:40
@webarto University studies + Job + moving further with PHP
what of?
@blackbee k
update us
@NikiC: remember the decorator construct concept from a while ago?
I think I may have figured out how to do it with little to no engine changes...
one of the last question... i am using a timestamp to store the time in the database corresponding to each comment made on a post..... now wats the way to show in how much time was he comment made prior to the post was posted... like .... it will display... responded in 23 secs...
@Nile
20:44
@blackbee date() I believe
what does date do?
@Petra or accept an absolute uri because
google uses 80 different base urls for 1940234 apis
isn't it like DATETIME that stores the date and time at a particular place not gmt based
20:47
@ircmaxell hi
o yes i remebered @webarto why is @ sign used
god PHP takes forever to compile in a VM
@blackbee means it is a timestamp
20:51
I will say, this is the first time I'm using safe_realloc
How difficult is it to write up a ToS which basically says "I'm not responsible for anything" for software that's going to be sold?
good php obeys netwons first law
@Alec pretty easy but it wouldn't hold up
@Alec "I don't give a crap about anything."
@Alec very easy... @Nile yes it would
20:52
@Lusitanian okay..
damn!! why rand(1,4) or mt_rand(1,4) doesnot produce 1 2 1 1 3 4
um, it gives you one pseudorandom number between 1 and 4
and is it always constant
@blackbee no...
no matter how mmany times u execute it?
20:55
no...?
@ircmaxell You at nephp?
@Alec - You might be able to find a Creative Commons license, then all you have to do is copy it and change company names to your own. :-)
then why does the post boxes always keeep moving more toward the left... with every itetration
Hey guys, what's the best way to pull info in php, such as what month or day, from a current_timestamp that looks like 2012-08-09 01:52:57
20:58
and then send that output to date() and get what you need
Thanks
please stop staring crap
"Star as useful". It was useful.
I don't think my answer was crap...?
"Star this message as useful / interesting for the transcript."
21:02
@AlexCastro m it was user for you , but everyone else here is able to read PHP manual
So by what you just said, if I read "star this message as useful", I should star it, because I found it useful.
if you found link to php.net useful , then you are just a sad noob
php.net should be the most useful message... his point is that all you need to do is a quick search.
Why so rude teresko?
@AlexCastro , stars are for "useful or might be interesting to EVERYONE"
21:07
You just rewrote it and quoted it, lol.
@clone1018 , because i have an allergic reaction to cretins
You should get that checked out then.
@tereško No need to be rude man.
It's really unnecessary and just plain mean. I'm coming here for help and not to be called names.
4
so , i should just be happy about you polluting the chat room
Maybe you should go back to sleep and wake up on the right side of the bed, there will always be new people, people who don't know every function or don't know how to use the manual, you shouldn't insult them for learning, you should instead post something better then what I posted or just not respond at all.
21:11
maybe you should stop staring each others messages
Hi guys. Just a quick message. Flag spam is not fun. I speak for all mods on this chat.
4
I don't even know how to flag, don't accuse me of things please.
Found the 'bug', I was echoing res instead of row haha.
@KendallFrey , star spam is even less fun
Star spam? I put two stars.
21:13
Don't even mention star spam. It gets me hot under the collar thinking about it. (Fortunately the culprit in C# has been suspended).
Star one more message...I dare you.
Say "star" one MORE TIME
star
@KendallFrey , that's why i flagged the messages , to get them suspended
You flagged our messages cause I put two stars? What about you calling me a noob and a cretin?
Totally uncalled for.
I think you should 'flag for moderator' instead of 'flag as spam/offensive'
21:15
Can we simply quit our bitch fest over a 3px by 3px icon popping up near a message?
@Alec no!!!! stars are srs bsns
10px * 10px actually
Ouch.
A entire 91 more pixels, oh no!
i only have 1024000...
i only have 1764000
21:18
@Nile i did it
House M.D. time Be right back soon, buddies
@blackbee good...
did it work?
yes... now its comming random. i just used an array and selected the values from the array randomly
LOL.
is this lol for you too @Lusitanian
....?
i'm probably missing smoething
21:23
rand(1,4) isnt returning a random number, so instead he put all the values in an array and selected a random value in that array.
i dont know why it wasnot happening. but sometiomes i believe shit happens
yes, so put a band-aid over it and forget it happened
great idea
but i couldnot figure out where to apply the # trick, if the user clicks on submit button he is taken to a a submitpost.php where as soon as the form/ coment input from the user takes place he is redicted to the main page via the command header("location:index.php");
where to make the # trick?
@ircmaxell So, did the poc work out?
@blackbee after index.php
21:29
I have a file dependencies that is two folders above my current file.
is there a php equivalent to cd .. that I can use on dirname(__file__)?
so ex folder C:/a/b/c/myfile.php and there is a file named C:/a/dependency.php
header("Location:index.php#$row[comment_id]"); ?
i want to go:
require_once(some_fun(somefun((dirname(__FILE__))).'dependency.php');
also there is another depedency that goes:
C:/a/d/dependency2.php
How do I do that?
21:52
@Nile $url="/".dirname($_SERVER['PHP_SELF'])."/board.php#".$row['cmmnt_id'];
header('Location: '.$url); is not working. it says object not found
@blackbee where does it say that
i post a comment under a post and then i press comment.. it is meant to reload to board.php but instead it stops at localhost/board.php#4 : and says obeject not found
i wonder why is it not taking the folder name
is the syntax wrong?
well it shouldnt...
shouldnt work or shouldnt show the error?
show the error. where are you getting the error?
21:58
in which line? then i think in the header
is this a php error?
no no the queries are succesfully executed
i can tell u this coz when i press the back button the comment i wrote is visible and in the tables too i can see them
WHERE are you getting this error? javascript? php?
console?
o in the browser
i restarted the xampp server twice.. first i got mysite;/board.php#4. now the localhost is missing
i agaiin restarted and added localhost/dirname...
it showed localhost/mysite/local/mysite......
damn...... once the webaddress doesnot have the dirname and once it was both of them twice. what a mess
well @Nick i tried "/mysite/board.php#".$row[commnt_id]... it successfull redirected to the page but it again ended up on the top not to the desired position
nile you mean?
22:07
ya ya
mispelt the name........
does the comment div have a name?
:P
yes
must be your browser then...
its firefox
:(
:)
okay.
well I'm not sure.
22:12
should the name be just any name or anything significant?
that is a very big book for not so big task... :P
what did u mean by it may have to be an element?
<a> element
then should i write <a><input type="button" name="postcomnt" value="Post It"/></a>
no...
<a name="$row[id]">
22:22
ya sure
happening
@Nile its happening..... if id is used instead of name... wud it work?
dont think so, try.
it works with id too....
but i will keep the naame
how to do this.. display 4 comments and then display more when show more is selected?
i can't help anymore, sorry :/
22:38
i mean know that we need to use a limit by 0,4 and when the user selects show more ........ ok fyn leave it... some other day.......
nyways thaks for being with me.... u were probably the first person in the rooom whu helped me persitently... thank u
22:55
@blackbee please try to normalize your English, pretty please.
Hey @Nile :D
@AlexCastro hello
My site's been great :)
nice

« first day (665 days earlier)      last day (4510 days later) »