Jump to content

tascam424

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by tascam424

  1. Thanks for your reply and apologies for not including correct information. I understand what you are saying however i'm still not getting it correct. I believe i'm not enclosing the html correctly The error i am getting is Here is the line of code as i have tried to amend it based on your previous direction, but i'm obviously going seriously wrong somewhere. echo "<td><a href="tracks.php?DiscNo=" . $row["DiscNo"]; . "</a></td>"; Really appreciate your help !!
  2. I would greatly appreciate any help in debugging this piece of code. But please be aware i am an absolute noob and have really just botched this together through trial and error, so please be gentle if you discover a school boy error (as far as php is concerned i am a school boy) So the problem lies pretty close to the end of the code where i am trying to pass a database value into a URL, i'm pretty sure you can see what i am TRYING to achieve. <?php $con=mysqli_connect("localhost","host_admin","mypassword","host_cdg"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT DISTINCT DiscNo, Description FROM CDG ORDER BY DiscNo"); echo "<td><input type=\"checkbox\" onClick=\"toggle(this)\" /> Toggle All<br/></td>"; echo "<table> <tr> <th>Tag</th> <th>Description</th> <th>DiscNo</th> <th>View Songs</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td><input type=\"checkbox\" name=\"checkbox\" value=\"\" id=\"checkbox\"></td>"; echo "<td>" . $row['Description'] . "</td>"; echo "<td>" . $row['DiscNo'] . "</td>"; echo "<td>" . $row['TrackNo'] . "</td>"; echo "<td><a href=\"tracks.php?DiscNo=<?php echo $row["DiscNo"]; ?>\"</a></td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?> Greatly appreciate any help, thanks
  3. I was wondering if anybody would be so kind as to help me write a woocommerce function. I am by no means a coder so i really appreciate any help you can offer. What i wish to achieve is for a function to calculate the quantity of items in cart and then change the total order price based on predefined values. So for example all items are £2.50 .. what i want is for the function to count the items and if 5 items are in the cart change the cart total to £10 .. if 10 items are added change the cart total to £20.00. I am aware of some discount plugins which may achieve something similar, but i don't actually want to apply a discount, i would really prefer to change the total automatically and not display a discount. Once again i greatly appreciate any help.
  4. Hi i am an absolute PHP/MYSQL Novice but i guess we all gotta start somewhere. I have a table in my database with names and addresses, f_name, s_name, street, zip_code, city etc etc etc What i want to do is display a drop down of all cities in my database then click on any city in the list to display all the details of people in that city, showing all fields. So i have got this far .. $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'cities_wrdp1'; mysql_select_db($dbname); $sql = "SELECT DISTINCT City FROM PBM"; $result = mysql_query($sql); echo "<select name='City'>"; while ($row = mysql_fetch_array($result)) { echo "<option value='" . $row['City'] . "'>" . $row['City'] . "</option>"; } echo "</select>"; This produces the nice drop down list of cities from the database ... Now on click i would like to return results similar to this $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'cities_wrdp1'; mysql_select_db($dbname); $query = sprintf("SELECT * FROM PBM"); $result = mysql_query($query); if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message); } echo "<br />"; echo "<table border='0'>"; while ($row = mysql_fetch_assoc($result)) { echo "<tr><td>"; echo "<a href=\"" .$row['profileURL'] . "\"> <img src=\"" . $row['faviconURL'] . "\" border=0 alt=\"" . $row["Thumbnail"] . "\"> </a>"; echo "</td><td align='center'>"; echo $row['f_name']; echo "</td><td align='center'>"; echo $row['s_name']; echo "</td><td align='center'>"; echo $row['number']; echo "</td><td align='center'>"; echo $row['street']; echo "</td><td align='center'>"; echo $row['zip']; echo "</td><td align='center'>"; echo $row['city']; echo "</td><td align='center'>"; echo $row['Country']; echo "</td><td align='center'>"; echo $row['email_address']; echo "</td><td align='center'>"; echo $row['fb']; echo "</td><td align='center'>"; echo $row['web_site']; echo "</td><td align='center'>"; echo $row['phone']; echo "</td><td align='center'>"; echo $row['land']; echo "</td><td align='center'>"; echo $row['age']; echo "</td></tr>"; } echo "</table>"; mysql_free_result($result); So my question is .. how do i make the first piece of code selectable to produce similar results to the second piece of code based on the city selected ? Thanks for any help .. and please excuse my ignorance ..
×
×
  • 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.