« first day (1030 days earlier)      last day (3934 days later) » 

10:00 PM
@Simon_eQ it's like asking "did you abondened clearDocumentFragment for jquery ?"
 
Anonymous
I mean, considering the amount of hoopla there is about Doctrine. Do you opt to use PDO/mysqli here and there, or do you use Doctrine for everything? @tereško
 
@Tredged You don't want to get some results, process them with PHP and then construct a query to get the real results you want
 
Anonymous
@tereško jQuery is Chinese to me. Pick another example.
 
@Simon_eQ i never use ORMs, if i have a choice
 
Anonymous
@tereško But, doesn't the fact it makes it easy to work with database, make it the only choice for you? In which case, you should be only using it?
 
10:02 PM
simon, you should see this.....

<?php
include 'header.php';
include 'database_cnn.php';
$per_page = 3;
$query1= mysql_query("SELECT count( 'a_id' ) FROM all_artists ");
$z=1;
$pages= ceil(mysql_result($query1,0)/$per_page);
$page = (isset($_GET['page'])) ? $_GET['page']: 1;
$start = ($page-1) * $per_page;

$query2 = mysql_query("SELECT a_id, artist FROM all_artists LIMIT $start, $per_page");
$num_rows = mysql_num_rows($query2);
if ($num_rows <= 0)
echo "<h1>Sorry, No results found.</h1>";
else {
 
Anonymous
I just need to know, if abandoning PDO is good idea, similar to what I did with mysql_ some months ago
 
@Giliweed pastebin please
 
@HamZa Bedankt, zal het aanpassen.
 
@Tredged It's quite difficult to get it right.
You're welcome btw ...
 
what me to give the data base too?
 
10:04 PM
@Simon_eQ pay attention: Doctrine is an ORM. It is not a part of core PHP. And it has all the common limitation of an ORM. The only cases where it makes sense to use some kind of ORM are: prototyping or a project with extremely simple DB structure (think: no joins).
 
@Giliweed no, I won't help you further
 
why?
 
@Giliweed BTW it's late there, so you should be getting some sleep
 
how can I sleep when I have a huge project to submit in a very short time?
 
Because I gave you the concept twice but you still don't get it or don't want to apply it. Even the workaround doesn't ring a bell.
So it's like I'm wasting time
@Giliweed When is the deadline ?
 
10:08 PM
Ok,,, this is the last time .... I also feel its a wast of time to make you understand...
 
Anonymous
@tereško I know it is not part of the core PHP. That is one part of my reluctance to adapt in on daily basis for my project. But, Unlike what you said, I thought, it was most useful when dealing with extremely intricate DB structures.
 
14th August
 
@Giliweed lol, I know what you want from the beginning
@Giliweed that's more than enough. I could build that in maybe a half day max (from scratch)
 
Anonymous
Anyway, I take it that you don't do ORM 100% of the time. Which is a good thing, because I don't like it much :)
 
@Simon_eQ it's exactly the opposite. If you have a highly sophisticated DB structure, then ORM will be extremely harmful.
 
10:09 PM
what's ORM?
 
object relational model , or object relational mapper
 
Anonymous
I thought "M" was for "mapper" anyway. Its good to know
 
where does this come from?
 
@Giliweed focus on your project
 
Anonymous
@Giliweed academia
 
10:11 PM
@Simon_eQ it makes no major difference
 
Anonymous
@tereško Yea, I guess it makes sense with model too.
 
people use both names
 
Anonymous
@tereško Anyway, I've got one last question, about PHPUnit.
 
Anonymous
or Unit testing
 
Anonymous
@tereško sound familiar ?
 
10:13 PM
(well .. there are other unit-testing frameworks for PHP, not only phpUnit)
what's the question ?
be quick about it , I'm going back to play SC2
 
ok... this is the last time... if any one tries my code ... he/she will see that data is accessed very well and all the artist names are hyperlinked to artist_profile.php which is no my requirement. I want the each artist name have hyperlink to different php files. or I say different artist page. get it?
 
Anonymous
Yea. I am on to PHPUnit instead of choosing simpleTest. As always, way in over my head. OK! I don't know what to do to test another than for similarity
 
Anonymous
I mean, the only tutorial I have seen helps compare if string output is similar to string xxx
 
Anonymous
But, I need more complex ways of testing the outcome of functions
 
Anonymous
For, which I can't seem to find a good tutorial for.
 
10:15 PM
@Giliweed See, I predicted from the beginning that you actually wanted us to write code for you. Which you maybe didn't realise at that time
 
@Simon_eQ I myself am only now starting to dip into making unit tests. You could poke around here and see my take on it: github.com/fracture/fracture/tree/master/tests
 
sigh
 
There are no "tutorials" for unit testing
everyone goes about it a bit differently
 
Anonymous
OK. The this tutorial for instance, shows only how to compare outputs to certain text.
 
the way i do it is , i take an instance , pass in parameters or call a method and check for expected result
 
Anonymous
10:17 PM
Which is so simple, I should not even be reading it. I guess what I am looking for is, In how many ways can testing be done in PHP
 
@Giliweed You know, I can help you.But you won't learn anything from it
 
Dunno. I only know how i do it =]
it's not like i have been in an environment where i could learn unittesting at work
 
is there any tutorial... to began with?
 
@Giliweed Surely there is, but how to find it ...
 
same here....
 
Anonymous
10:19 PM
@tereško Oh. Well, I wish you luck on that subject
 
how to find it .... how to do it....
 
@Giliweed That's actually a question for you
 
ha ha
 
anyway, I already linked you to a location where you can see how I write my tests
you will have to learn from examples
 
Anonymous
@tereško appreciated. Go to you games now :)
 
10:20 PM
you might look into how symfony-related projects do it
also rdlowrey's projects have unit-test you could looks at
 
does my problem contains anything related to ORM?
 
Anonymous
@tereško I found a couple based on sf2 actually. Just wanted to learn it independently
 
@Giliweed no
 
lol
 
I knew it!!!
my code is very simple
 
10:22 PM
@Giliweed yeah, yet very vulnerable
 
If I can make it a little complex I might get a good grade
 
> sudo pm-hibernate
 
your talking about SQLingection ?
injection
 
Gotta go, cyaa all
 
Anonymous
10:24 PM
@HamZa laters
 
good bye
 
@Giliweed you meant sad bye
 
:D ... bye bye ...
 
Anonymous
@Giliweed If you want to correct your comment, for probably spelling mistake. Just press the up arrow key
 
happy?
 
10:25 PM
@Giliweed (hug)
 
you tooo... (hug) ... :)
 
<<< 4 ever alone
 
one funny guy ... !!!
 
Anonymous
@HamZa GET OUT already
 
Anonymous
You could be flirting with a man, for all I know.
 
10:29 PM
I just said his funnnY ....
I don't have time for flirting ... have to submit this before 14th aug
if some how it is possible to have a function and make it parametrized .. do you people support this idea?
 
Anonymous
I support everything, except the way you explain your questions.
 
@Giliweed Are you asking is it good practice to pass in parameters to custom functinos?
 
goood one ... simon ... good one
jeremy, creating function with parameter is not the problem ... problem is where to place it.
 
Anonymous
10:44 PM
function foo($parameter){
  echo "I am a $parameter";
}

foo('fool');
 
Anonymous
@Giliweed There is no problem
 
where?
 
Anonymous
@Giliweed I am showing you the "Where to place it part"
 
you are really ... what can I say ... tube light :D
 
Anonymous
I hope that is a good thing
 
10:47 PM
I meant where to place the function inside the while loop
tubelight is takes 30-40s to light up ... where normal bulb takes 1-2s
 
Anonymous
function myfunction($param){
	echo $param;
}
while(1 = 1){
	echo myfunction($argument);
}
 
plz don't mind ... I'm joking
 
if I do this then there are problems. when the loop runs I don't want the function to be called. when artist name is clicked then it is needed but the artist names are directly from db ... so I'm confused where to put the function (not sure it is ever possible )
that is MVC?
 
Anonymous
"When the loop runs I don't want the function to be called. " Then, don't nest the function inside a loop statement.
 
Anonymous
10:53 PM
Its as easy as that
 
@Giliweed no
 
but if I don't use the function inside the loop how do I set the parameter? thinkin something that will set a parameter and when the link is clicked it will use some swich / if statement to match and then take me to the required page ...
its still a thought
thinking if it is ever possible to do it.....
each time the loop runs new parameter will be set
thinking something like this
 
Anonymous
@Giliweed Just ask in SO main site, and be done with it.
 
I can't my account is blocked
 
Anonymous
hmm, No surprises there..
 
10:59 PM
as you said It's difficult to ask question prefectly
 
Anonymous
It would've been much easier if you could skip the technical details, and tell us what you want your script to achieve.
 
very very difficult to make someone understand what I'm saying
what is MVC?
 
Anonymous
MVC stands fo Model View Controller.
 
Anonymous
It is a design pattern.
 
Tredged once told about array ... I think gave a clue
 
11:05 PM
Alright I have a really odd issue what I have totally hit the wall with
So I have inherited a joomla site which uses the fabrik plugin for forms
and I don't have time to recode it completely before it has to be live
I put it on my win 2k8 server with no problems
I put it on the staging server for the group hosting it and after like 3 hours of php configuration it works there
 
if the id's are in an array and those are .... um um ,,,, so Confused :(
 
but the moment I push it to the production server the requests for the form either hit the php max execution time and 500, or give me a database connection error after loading for about 25 seconds
Which doesn't make any sense because the database credentials are literally the same
Any ideas?
 
Anonymous
@BadWolf No one I know here uses Joomla. You are better of asking in it the real meta after this.
 
Ok thanks
I'm getting to the point where I'm tempted to just nuke the whole thing from orbit and rebuild it from the ground up
but I don't have time tbh
 
Anonymous
@BadWolf nuking the whole thing is always a good idea. Just takes so much time to re-build the working parts again
 
11:10 PM
Don't sippose anyone's familiar with Solarium, the Solr library for PHP?
 
Anonymous
Not me ^
 
Nope sorry
 
How about Composers autoloading? :P
 
Anonymous
composer / auto-loading ring few bells.
 
Anonymous
I am not sure, I am at the level, when I can helps out though
 
11:18 PM
Ah well I doubt it's a composer / auto-loading issue anyhoo
 
$z=1
while($row = mysql_fetch_array( $query2 )) {
echo
"<tr>
<td>".$row['a_id']."</td>
<td><a href= 'artist_profile.php'>".$row['artist']."</a></td>
</tr>";
profile_manage($z++);
}

if I do this ,,, is there any possibility to create a connection with the function and the ".$row['artist']."?
hoping to have a switch statement inside the function. but how to join the funcion and the 'artist'?
 
Anonymous
@Giliweed Still asking :/
 
I'm in a dead end.
 
I don't really understand the question
 
ok... just tell me am I in a right path or not .....
 
Anonymous
11:23 PM
@Fabien Nobody does.
 
Anonymous
She has been asking that question for more than two hours. Nobody get the question
 
heyyyyy :p
 
What do you mean connection between the two?
 
Anonymous
@Giliweed I would've made the entire script for you an hour ago, had you taken a little effort to simply elaborate your problem
 
sigh
 
11:25 PM
heh
The problem with problems in PHP is more how to convey it to someone else so they can understand and help.
 
connection means if the loop runs the function will parameter something that will match/identify row['artist']
 
Anonymous
LOL: Still nothing!
 
Like profile_manage($row['artist']);
 
I have questions for your script ...pastebin.com/RmC1qiti
I saw it ...
 
What does profile_manage() do?
 
Anonymous
11:28 PM
Yes, what does profile_manage($z++); do?
 
Anonymous
<?php
if(!isset($_GET['id']) && empty($_GET['id']) && ctype_digit($_GET['id']) === false){
		echo 'Link does not exist, or may be expired';
	}else {  $page = $_GET['id'];
		    $query  = "SELECT name, age, imag FROM tables WHERE id = $page";
		   $result = mysql_query($query);

	if(!$result){
		echo 'page not found: ',mysql_error();
	}else{ $details = mysql_fetch_array($result);
		       echo $details['name'].'<br/>';
		      echo $details['age'].'<br/>';
		     echo 'images/'.$details['image'].'<br/>';
 
I'm no sure .... trying to send a parameter so that ,,, when the artist is clicked the funtion runs
 
You're not sure what your own function does?
What you want is something like this
 
Anonymous
What do you want the page to do, when the artist's name is clicked?
 
I'm thinking to put a switch statement inside the function.
when clicked :run the function + match the parameter + then go to a specific link
 
11:32 PM
if(isset($_GET['a_id']) && $_GET['a_id'] != '') {
    profile_manage($_GET['a_id']);
}

while($row = mysql_fetch_array( $query2 )) {
    echo
    "<tr>
    <td>".$row['a_id']."</td>
    <td><a href= 'artist_profile.php?artist-id=".$row['a_id']."'>".$row['artist']."</a></td>
    </tr>";
}
Notice the change of the link
 
Anonymous
@Giliweed why can't you just put the artists name inside a link, so when he clicks he will go to other link
 
Anonymous
<a href= 'artist_profile.php?artist-id=".$row['id']."'>".$row['artist']."</a>
 
thats what I want!!!! finally you understood me !!!!
 
Anonymous
@Giliweed We suggested the same thing hours ago.
 
Yes it was "when the artist is clicked the funtion runs" that cleared things up.
 
11:34 PM
noo... wait.
 
suspenseful...
 
but how are you gonna put this inside the while loop?
 
Gili try my code.
 
I'm accessing these artist names form the db directly
 
Anonymous
Just put it. The while loop will populate the links.
 
11:36 PM
really?
 
@BenjaminGruenbaum here's the question btw pastie.org/private/ykoivvxklyqy2ciorfr7lw
 
really?
 
Anonymous
It will get all artists from the db and show them in links
 
Anonymous
just try it, if you have 100 artists in your db, it will show 100 links with that much difference artists
 
Keep this bit out of the while loop

if(isset($_GET['a_id']) && $_GET['a_id'] != '') {
profile_manage($_GET['a_id']);
}
 
11:40 PM
sorry to say simon, when I click on any of the artist name it just reloads the page . :(
 
Look at the URL
Also, you used "a_id" and not "id" right?
 
Anonymous
@Giliweed use the code fabian is giving you.
 
http://localhost/abc/IPA_3rd_session/artist_profile.php?artist-id=2

yes the url changes but ....
 
Anonymous
So, what is the problem. If you clicked on artist number two, it should take you to that URL exactly.
 
The URL contains the id of the artist you clicked on right?
 
11:43 PM
the url is changing but shows the same page
 
Anonymous
You can't say it relods the page, because this page is different than your other page (where your loop is )
 
yes
you are right
 
Gili in your PHP add
 
Anonymous
@Giliweed Start from 0. Create to pages. 1 call it index.php and second call it profiles.php
 
Anonymous
Put your loop code in index.php
 
11:44 PM
but all the artist names result in same page (not the link)
 
really dumb question, what does -> mean in php?
 
    echo "<pre>";
    print_r($_GET);
    echo "</pre>";
 
ie $mysqli->query
 
Anonymous
and in profiles check the id
 
davis its for objects
 
Anonymous
11:45 PM
@mbdavis It accesses objects properties / methods
 
what does it do?
oh okay
 
febien ... still haven't tried your code ... wait
 
thank you!
 
Example:
$array['key'];
$object->property;
properties aren't the same as key though
 
what does that mean?
whats the relevance of the array?
 
11:48 PM
I wouldn't concern over it too much unless you wish to start learning OOP.
 
Anonymous
class test{
	public $name = 'simone';
	function sayHello(){
		return $this->name;
	}
}

$object = new test();
echo $object->sayHello(); //will say simon
 
Which you should eventually :)
 
i know about OOP just new to php kinda
 
Oh
Well as Simon has shown.
 
used to object.method()
 
11:48 PM
hei.... give me time to try out the codes
 
thats helpful thank you @Simon_eQ
 
yeah it's essentially the . in ruby
 
Anonymous
@mbdavis no problem
 
is it ok to ask about mysql here as well?
 
Anonymous
@Giliweed What is your table detail? Give us, and we'll help you.
 
11:50 PM
Aye
 
ok, thanks, may have some questions in a bit
$result = $mysqli->query($query1)
this means that $result is an instance of the mysqli_result class?
 
Whatever class $mysqli is defined as.
 
Anyone know if it's possible to make an SQL query sleep for 1/10 of a second? I can see how to make it sleep for seconds, but need to test a shorter time than that.
 
well, it works but no change in the output... only the link changes
 
Anonymous
The output is in another page. Is it taking you there @Giliweed
 
11:55 PM
@Fabien thanks
 
simon ....yes it does
but
 
Hello Danack :)
 
'ello.
 
usleep ( int $micro_seconds );
 
the profile page opens and gives the same output as the index did
strange!!!
 
Anonymous
11:57 PM
Then that means, you have the same query in the profile page as you have in the index
 
Anonymous
check the URLs. Are you sure you are seeying to different URLs?
 
the profile page only has the header and footer
 
or if it's mysql's sleep, can't you use decimals?
 
@Fabien Nah - I need it to sleep in the SQL query like "select SLEEP(1), contentID, datestamp from basereality.content limit 5;" sleeps for 5 seconds total. I want to sleep for 1/10th second inside the sql
 
but strangely it shows the middle content of the index
:'(
 
11:58 PM
@fabien lol - yes you can!
 
Anonymous
Just post what is in the profile page. All your codes in pastebin.com
 
this is not suppose to happen
 
Anonymous
Give us you table information and I may help you better too
 

« first day (1030 days earlier)      last day (3934 days later) »