Software Development and Programming Careers (Official Discussion Thread)

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,291
Reputation
5,551
Daps
83,482
What do you guys think of php? I currently taking a web development/w php class and this seems easy for those that have a good handle on programming. But to me It seems very frustrating at times writing these codes. Also why isn't this thread sticky like the other IT thread?

i havent used much of php but the consensus seems to be that it works but it's not the most beautiful code.
 

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,291
Reputation
5,551
Daps
83,482
I think I'm going to get heavy into data structures and algorithms and mathematics soon. I already know enough languages decently enough. Time to really focus on the knowledge that spans across languages.
 

Renkz

Superstar
Supporter
Joined
Jun 12, 2012
Messages
7,814
Reputation
2,310
Daps
18,031
Reppin
NULL
@Gonzo I'm made some serious progress since then, I think I got inheritance, abstract, implementation, pointers, fiIeO, etc pat down I think. Last semester, OOP was kicking my ass, I barely pass that class, but now I'm squeezing an A in my data structures and data engineering class, next year graduation.:obama:
 

Milk

Pro
Joined
Sep 27, 2015
Messages
660
Reputation
390
Daps
1,619
Reppin
England
Does anyone know PHP here? I need help with a while loop calculating data from an array.
 
Last edited:

Milk

Pro
Joined
Sep 27, 2015
Messages
660
Reputation
390
Daps
1,619
Reppin
England
With regards to my post above...

I'm trying to create a while loop that gets data from two seperate database tables. When it does, it does a subtraction between a column from both tables. It checks if the result is over the "limit". If it's not, it prints out a coloumn data from the row.

Here's my code:
Code:
http://pasteguru.com/18798

I get an error in line 15 saying: "mysql_fetch_array() expects parameter 1 to be resource, boolean given in..."

Can someone tell me where I'm going wrong or how to better excute this code?
 
Last edited:

Sane

All Star
Joined
Dec 10, 2013
Messages
4,659
Reputation
1,310
Daps
8,315
Reppin
London Town
With regards to my post above...

I'm trying to create a while loop that gets data from two seperate database tables. When it does, it does a subtraction between a column from both tables. It checks if the result is over the "limit". If it's not, it prints out a coloumn data from the row.

Here's my code:
Code:
http://pasteguru.com/18798

I get an error in line 15 saying: "mysql_fetch_array() expects parameter 1 to be resource, boolean given in..."

Can someone tell me where I'm going wrong or how to better excute this code?
I haven't used PHP in years. But in line 15 I think you need to change $result1 to $res1, as that is the name of the variable you declared before. I could be wrong.
 

Milk

Pro
Joined
Sep 27, 2015
Messages
660
Reputation
390
Daps
1,619
Reppin
England
I haven't used PHP in years. But in line 15 I think you need to change $result1 to $res1, as that is the name of the variable you declared before. I could be wrong.
You're right, thanks for pointing that out.

However, I still get the same error. :/ I'll keep working on it.
 
Last edited:

Sane

All Star
Joined
Dec 10, 2013
Messages
4,659
Reputation
1,310
Daps
8,315
Reppin
London Town
You're right, thanks for pointing that out.

However, I still get the same error. :/ I'll keep working on it.
Try changing && to || in line 11 so it displays an error when either of the queries is false.
And in line 15 try adding parenthesis like the following:
Code:
while(($row1 = mysql_fetch_array($result1)) && ($row2 = mysql_fetch_array($res2)))
 
Top