Jump to content

a1phanumeric

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

About a1phanumeric

  • Birthday 02/19/1985

Contact Methods

  • MSN
    eddster19@hotmail.com
  • Website URL
    http://www.edsadesigns.com

Profile Information

  • Gender
    Male
  • Location
    Torbay, South Devon, UK

a1phanumeric's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Swap all your speechmarks for single quotes AND single quotes for speechmarks OR Whever you have a variable in the string, break out of the string using this for example: ".$variablename." Ed.
  2. Can you show the code that creates the array '$rt['iata']'? Cheers, Ed.
  3. Change your javascript so it includes the querystring: <?php if (condition){ echo '<script>window.location = "page1.php?verif"</script>'; } else if (condition2) { echo '<script>window.location = "page2.php?sinput"</script>'; } else { echo '<script>window.location = "page3.php?linput"</script>'; } ?>
  4. If you just echo out '$rt['iata']' do you get anything at all? Ed.
  5. Hi dude, Can you post the full MySQL error you get? It'd make it easier for me to diagnose the problem for you. Additionally, I wouldn't recommend creating a new table for each clan. Ed.
  6. Can you post an example URL to that page (with the query string). Ed.
  7. Hi, Just before this line: $featuredresults = "SELECT * FROM products WHERE cat = '" . $cat . "'" . ($subcat != "" ? " AND subcat = '" . $subcat . "' " : "") . " AND featured = 1 AND publish = 1"; insert: $sSubCatAndClause = ''; if($subcat != ''){ $sSubCatAndClause = " AND subcat = '" . $subcat . "' "; } Then change your query to: $featuredresults = "SELECT * FROM products WHERE cat = '" . $cat . "'" . $sSubCatAndClause . " AND featured = 1 AND publish = 1";
  8. No worries Yes, it's possible to have the database update when someone clicks on the image. - My personal preference would probably be an AJAX call (using Prototype) to POST some data to a PHP page which can run server-side code to update the database. After that ajax call, you can then redirect to user to wherever the image link goes to. - The other method would be to create a 'bounce page', whereby it'd work like this: 1. Adjust the code that 'echoes' out the image to change the link to 'www.YOURSITE.com/bounce.php?id=6' - where the link always refers to your 'bounce page', and it also builds a query string with the images' ID. 2. Create a bounce page that will read in the ID passed to it, then read from the database the image relating to that ID, as well as the link that the user should be forwarded to. 3. Update the record in the database, also based on the ID sent by the previous page. 4. Then redirect the user to the page you obtained in step 2. Hope that makes sense! Ed.
  9. Have you got access to running MySQL commands via an interface such as phpMyAdmin / MySQL Front / Shell Access? If so, copy the query once it's been echoed out and try it using one of those interfaces mentioned above. Let me know if that works ok. Ed.
  10. Hi, Change your form to include this parameter: enctype="multipart/form-data" (so it looks like '<form id="frmAddMusic" enctype="multipart/form-data" name="frmAddMusic" method="post" action="uploadmusic.php">'), and add a hidden field like the following: <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Change the 100000 to whatever you want, 100000 = 100kb Ed.
  11. Hi, Have you tried replacing the Ternary Operators within your MySQL queries with if statements before the actual construction of the query? It may not help, but it's an idea? Let me know if this does not help, as I'll think of some more ideas Ed.
  12. Hi DasHaas, Why don't you add the following just before you close your MySQL connection: <?php // includes include('includes/PXS_Conf.php'); // open database connection $connection = mysql_connect($host, $user, $pass) or die ('Unable to connect to MySql server!'); // select database mysql_select_db($db) or die ('Unable to select database!'); // generate and execute query // NEW CODE PART 1 // // I changed the mysql query to // also retrieve the impressions_left field data $query = "SELECT id,HREF, SRC, ALT, impressions_left FROM PXS_Ads WHERE status = 1 and type =1 and impressions_left >0 ORDER BY RAND() LIMIT 1"; // END NEW CODE PART 1 // $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); while ($row = mysql_fetch_object($result)) { $HREF = "$row->HREF"; $SRC = "$row->SRC"; $ALT = "$row->ALT"; // NEW CODE PART 2 // // Grab some extra data from the DB $ID = "$row->id"; $IMPRESSIONSLEFT = "$row->impressions_left"; // END CODE PART 2 // ?> <table width="729" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td scope="col"><a href='<?php echo($HREF); ?>'><img src='<?php echo($SRC); ?>' name='<?php echo($ALT); ?>' border=0></a></td> <?php } // NEW CODE PART 3 // // Decrease the impressions left by one... $IMPRESSIONSLEFT--; // ... and update the DB $query = "UPDATE PXS_Ads SET impressions_left = $IMPRESSIONSLEFT WHERE id = $ID"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // END NEW CODE PART 3 // //close connection mysql_close($connection); ?> Hope this helps! Ed.
×
×
  • 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.