Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

PHP begginer needs help to display MySQL data

Name: Anonymous 2013-05-29 3:04

Hi, /prog/, first time poster here. I'm new to programming, actually I'm just a farmer a bit interested in IT. So I want to make this website where you could compare different kinds of combine harvesters.
I already created a MySQL database which has 63 columns and about a 1000 rows.
I tried basic things and it works, but when I want to do intermadiate things I get stuck.

So I want to make something like this:
http://www.dpreview.com/products/compare/side-by-side?products=nikon_d90&products=nikon_d3&products=nikon_d4&sortDir=ascending

Firstly, what is a best way to get multiple $_GETs with the same name (in this case "products")?

Secondly, what is a best way to dislay results like in DPreview link?

This kind of code is short and does it's job pretty well:

>while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Make'] . "</td>";
echo "<td>" . $row['Model'] . "</td>";
echo "<td>" . $row['FuelTank'] . "</td>";
echo "</tr>";
}

But when I add aditional product to compare I want a new column, and not a new row.

Hope you guys are helpful.

Name: Anonymous 2013-05-29 3:16

You need to try prayer. I don’t know if you believe in the spiritual realm. It doesn’t matter if you do. Not believing in air doesn’t cause it to not exist or affect your life. It is the same with the Spiritual. What is affecting your thoughts in this evil to harm a defenseless child is not your own nature, but is demonic influence. I am not saying you are possessed and there is no need for you to be frightened.

I do not have shared experience but I have experienced the spiritual realm and I can sympathize.
Basically as I have experienced it there are two options. We can live without God and be “free” – when in fact that means that we are defenseless against the demonic realm. Demons are evil Spirits which try to keep as low a key as possible- they give us evil thoughts, prompt us to do evil actions – all without us realizing that it is not us… and if you allow on to possess you they can fully control your being – at this point of extremity others who know you will realize that it is not you and that you are controlled by something outside of yourself.

There is a lot of watered down crappie Christianity out there.. but if you go to the red letters in a bible – the words that Jesus spoke you will realize that because of our enslavement to Satan – to a small degree (thoughts) or to a large degree (possession) this is why Jesus came to earth, a blood covenant to buy back our right to relationship with God, to see Captives to demonic power free.. Jesus said I give you authority in my name to cast out demons – to prevent their influence to set captives free… a lot of the church/Christians are not doing this.. I’m sorry I can’t just direct you to your nearest Christian and they could help you. Although authority has been given many don’t function in it.

Basically, Jesus has the power to set your mind free from those thoughts... Would you like that? Then pray (talk to God) and say Jesus take my heart, I’m ready for you to be in control and not these rogue demons. Ask God to receive His Holy Spirit – which enters us to influence us to do well and then ask for a strategy to get rid of these buggers. You will have authority to drive these thoughts out. To be free from things that your heart desires where not there. ..

It’s an inward battle..
I’m not a normal “Christian” saying – Accept Jesus and be the same..
I’m saying Jesus is a bad ass warrior who loves you – your person, your heart enough to die for you – crazy right... You are the apple of his eye... He created only one you and has no other to take your place… and He has already beaten these guys… get on His team!

Name: Anonymous 2013-05-29 3:22

>>2

      To the best of my memory, before I came to the saving grace of Jesus Christ, I did not believe the Bible was true. I doubted whether God, Satan, heaven, or hell even existed. I believed that we were born, lived so many years, and then died. I had my own business and thought that I had succeeded by my own wits.
      One evening, my wife and I heard some documentation that these were the last days before Jesus Christ would actually return. Not wanting to hear it, I almost walked out. Something kept me there, and I listened but was not convinced; however, I decided to do some research to find out if the Bible was really true. Indeed, if I could find one contradiction or anything that was not true, then I could disregard it. I believed this would not take long. This led me into much research. I learned nearly one-third of the Bible is, directly or indirectly, related to prophecy, which includes about 10,000 prophecies. One thing needed was to determine when the Bible was actually written. Thus, a study of biblical history, various translations, and archaeology was necessary. The Dead Sea Scrolls, which were found in Israel, contained parts of the Old Testament, including prophecies of the coming of Jesus. It has been proven that these were written before Christ came. Thousands of clay tablets and archaeological sites also confirm many accounts in the Bible.
      I took time off and began studying the prophecies. My wife would spend much time at the library. She obtained documentation for me from reference books, which I would check against the Scriptures to see if the prophecies took place. One week went by and then a month. Every prophecy that we were able to get information on proved to be accurate. I was astonished, but still not convinced. Later, there were people who would show me what appeared to be contradictions in the Bible. These were not contradictions, but only a lack of research on the part of those that said these things. Stubborn, that's me. Even after four months of intensive study, proving prophecy after prophecy was true, I was still skeptical. Four months turned into six. I became more determined. It wasn't possible that the sixty-six books of the Bible, written by many people over hundreds of years, would not have some errors, I thought. Thousands of prophecies and every one perfect? No, impossible! If I would admit that, then I would also have to admit there was a God. I was not prepared to do that—yet, I wanted to know the truth. More months passed. Finally, I had to admit after spending almost countless hours of research—I was wrong. I may have been the biggest skeptic in the world, but now I know—the Bible is true and is the perfect Word of God. Anyone willing to take the time I did and do the same research could only come to the same conclusion, if they are honest with themselves. I became afraid that I would perish. I surrendered my life to Jesus Christ, the only begotten Son of God, as a result of His love, compassion, mercy and grace.
      I know that there is none other name under heaven given among men whereby we MUST be saved (EXCEPT JESUS)-ref Acts 4:12. I REPENTED of my sins and received Jesus Christ as my only hope of salvation by FAITH-ref Eph 2:8-10. It is written, EXCEPT YE BE CONVERTED, AND BECOME AS LITTLE CHILDREN, YE SHALL NOT ENTER THE KINGDOM OF HEAVEN-Mt 18:3. You can also call on Jesus NOW to be YOUR Lord and Savior.

Name: Anonymous 2013-05-29 3:27

>>2 >>3
Y' wat? Can't tell if trolling or not

Name: Anonymous 2013-05-29 3:28

I'm not a PHP guy, but for adding multiple rows, you could do a few things: The way to stick with a raw table structure would be to build a 2D array row by row (I think mysqli_result::fetch_array might do this), but then create your table column-of-the-2d-array by column-of-the-2d-array, so that your data gets rotated 90 degrees.  Then sleeker way to do it, I think, would be to use CSS so that you can define an arbitrary number of <div> elements that stack left-to-right, and then within those you can put more absolutely <div> elements to make a top-down table-ish structure (make sure to deal with the CSS alignment, otherwise long entries in one result could throw off the table-like structure).  Then you can just loop through each of your products and fetch the row as you're doing now.

For getting multiple values, it looks like you want explode('&', $_SERVER['QUERY_STRING']), but then you have to loop through the resulting array and do key-value matching yourself by explodeing on '='.  It might be worth it to just set a maximum number of products to compare and pass them all as product1=, product2=, product3=, etc.

Name: Anonymous 2013-05-29 4:00

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-05-29 7:18

>>5
You think CSS should be used to emulate tables? WTF!

You need to query multiple rows and traverse the rowset column-major instead of row-major.

>>6
First read that as std::mosquito and then "standard mosquitos". lolwut.

Name: Anonymous 2013-05-29 10:32

>>4
Y' wat? Can't tell if trolling or not

Name: Anonymous 2013-05-29 10:38

>>7
stfu you elitist fag

Name: Anonymous 2013-05-29 14:31

>>7
Now my brain is tainted forever.
Go away STD library.

Name: Anonymous 2013-05-29 16:02

>>12
Jews

Name: Anonymous 2013-05-29 16:05

Hey >>11, who is responsible for PHP?

Don't change these.
Name: Email:
Entire Thread Thread List