Jump to content

ronc0011

Members
  • Content Count

    54
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ronc0011

  • Rank
    Regular Member
  1. OK never mind I finally spotted what the problem was . The variable "conn" didn't have the right syntax. It should have been "$conn" Fixed it instantly.
  2. Honestly I’ve hit this wall more times than I can count. It typically turns out to be something seemingly arbitrary like single or double quotes and only maters sometimes and sometimes not. OK enough with the ranting. Here is the code that is making me pull my hair out… It’s a PDO connection string that I’m getting from a Youtube video. $host = "127.0.0.1"; $user = "root"; $pass = "r00t"; $db = "cars"; try{ conn = new PDO ("mysql:host=$host;dbname=$db", "$user", "$pass"); conn -> setAttrabute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Oh happy day we have connected to our databa
  3. I’m working on building a web (html) form for a vehicle maintained app. I think most of it will be pretty straight forward but the first problem is building the dropdown list for Make & Model. I have found some info on doing this with javascript but I’m wondering if there is a way to do this with PHP. Basically I need to make a dropdown list of Automobile brands / makes i.e. Ford, Chevy, Dodge, etc. Next I need a second dropdown list of models. The models need to be dependent on the Make selected in the first, “Make” dropdown. So if Ford is selected on the “Make” dropdown then the option
  4. This apparently was the issue It's not the first time I've been tripped up by the double / single quotes issue. In fact I did have that string as double quotes originally and swapped them for single quotes when it wasn't working . I don't remember why / how it wasn't working. That was 4 days ago.
  5. Hmm.. I’m not real sure what the fifferencwe was but I’ll review is later I actuall had a previous version on the file commented out which I just swapped for the one that wasn't working and apparently that was the problem, made the swap and every hing started working So here’s the working version… $conn = new PDO ( "mysql:host=" . $db_host . ";dbname=" . $db , $db_user , $db_pw); var_dump ($conn);
  6. Really? You're thinking there's a problem with the PDO connection string?
  7. Thank you for your quick and informative response. I made the corrections you noted . In fact when that didn’t seem to work I copy / pasted it into my page. Still no joy. So now that block reads thus… <?php $query = "SELECT * FROM t1" ; $result = $conn->query($query); if ($result->rowCount()>0) { foreach ( $result as $item ) { echo ( $item ['name']. $item ['email']); } } ?> Still getting the same error. Actually I had suspected the line you referenced but couldn’t spot the problem. However I wasn’t aware of
  8. I don’t seem to be able to find the issue with this code. I’m following along with a tutorial I found on Youtube and so far I’ve managed to get everything to work . This piece is toward the end of this particular section and it’s giving me this error and I’ve looked and looked and don’t seem to be able to find the problem I have a file named conn.php and of course a file, index.php. The connection string is in “conn.php” like so… <?php $db_host = "127.0.0.1"; $db_user = "root"; $db_pw = "r00t"; $db = "test1"; echo "$db_host <br/> $db_user <br/> $db_pw <br/> $db <b
  9. Actually I just deleted several copies of the TS versions in order to clear room on my little Surface Pro. As noted before every time I tried to use PHP7 Apache wouldn’t start and googling it only turned up pages citing the missing dll issue. Thus my views on the state of modern American education.
  10. Well, what'd ya know? After a 2nd day of searching I've run across a site with links to the PHP7 downloads that are actually complete. This tutorial has links to the Apache24 downloads and the PHP7 downloads and wonder of wonders, these downloads actually have the “php7apache2_4.dll” file. I literally couldn’t begin to count the sites I went to and tried unsuccessfully to implement. Small wonder the big tech companies are outsourcing / recruiting overseas engineers and coders. The American academic environment is turning out useless wastes of time. BTW here is the page that actually provide
  11. I have spent an entire day trying to make this work and it simply will not do it. I have tried Apache from everywhere, finally from Apache Lounge. I have tried PHP version VC11, VC14 no matter what I try as soon as I add the line “php5_module "c:/php/php5apache2_4.dll" or “php7_module "c:/php7/php5apache2_4.dll"… whatever. Frankly it’s become impossible to keep up with all the myriad configurations. Well actually PHP7 doesn’t even have a “php7apache2_4.dll” even though any documents you can find on it will tell you to point to that file, It doesn’t exist. All I’ve been able to find on it is s
  12. I know this is a super newbie question but I am totally new to PHP and I’m coming from a Microsoft world i.e. ASP.NET also some early ActionScript. So today I’m hoping to find a good working explanation of these two operators.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.