Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About danmiddo

  • Rank
  1. Obviously I am more of a novice than i thought.. Any chance you could demonstrate how you would solve this?
  2. Any idea where i am going wrong now? -.- <?php if ($_GET["home"] == $_GET["away"]) { header("Location: same.php"); } // Connection data (server_address, database, name, poassword) $servername = "localhost"; $username = "username"; $password = "password!"; $db = "database"; if ($_GET["homegoal"] > $_GET["awaygoal"]) { $Home=$_GET["home"]; $Away=$_GET["away"]; $Goal=$_GET["homegoal"]; $GoalIn=$_GET["awaygoal"]; // Connect and create the PDO object $conn = new PDO("mysql:host=$servername; dbname=$db", $username, $password);
  3. Everything will be changed to post once its working, GET is purely for testing right now. and everything on the previous page has the security. Thanks for your help I shall try and sort this out again, and will update
  4. Yeah i know that the AND statement doesn't/wouldn't work i was just struggling for how to run 2 queries. I don't need to worry about SQL injection for this as all variables are sent from a previous page which has all values as pre defined values via drop down lists. have you any idea how i could work this into 2 executable queries?
  5. Yes I am aware the ASP code is poorly presented which is why im probably struggling so much what im working with at the moment is <?php if ($_GET["home"] == $_GET["away"]) { header("Location: same.php"); $servername = "localhost"; $username = "username"; $password = "password!"; try { $conn = new PDO("mysql:host=$servername;dbname=database", $username, $password); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected successfully"; } catch(PDOException
  6. i'm not sure if its because the .asp code looks a mess which is why its giving me the headache trying to make this work in php
  7. not to an advanced level like this appears to require
  8. I'm using MySQL with PHP version 5.5.38 and I'm coding it all from scratch
  9. It's the Update queries. As there are so many of them they don't work when I set it out in php
  10. I have been given a .asp file that needs converting into PHP, the only issue i am having is with the mass update fields. <%@ Language=VBScript %> <% if Request.QueryString("Home") = Request.QueryString("Away") Then %> <% Response.Redirect("same.asp") %> <%End If%> <% if Request.QueryString("HomeGoal") > Request.QueryString("AwayGoal") Then%> <% Home = Request.QueryString("Home") away = Request.QuerySTring("Away") Goal = Request.QueryString("HomeGoal") GoalIn = Request.QueryString("AwayGoal") Se
  • Create New...