Jump to content

fluxem

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fluxem's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. works great, thank you very much!
  2. Hi Suma I put that at the end and I still get the same error.. Here is my current code: <?php include ('connect/index.php') ?> <?php mysql_connect(localhost, $username, $password); @mysql_select_db($database) or die("Unable to select database"); $query = "SELECT * FROM saleitems"; $result = mysql_query($query); $num = mysql_numrows($result); echo "<center>Database Output</center><br><br>"; ?> <?php // display results $totalColumns = 5; $i = 1; echo "<table border='0' cellpadding='2'>"; while ($row = mysql_fetch_array($results)){ if ($i == 1) echo "<tr>"; echo "<td>"; echo "<img src=\"$image\"><br>$name<br>$classification<br>$percentoff<br>"; echo "</td>"; if ($i == $totalColumns) { echo "</tr>"; $i = 0; } $i++; } echo "</table>"; ?> <?php mysql_close(); ?>
  3. Him Simcoweb,, thank you for your reply! I am getting this error.. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/fluxar/public_html/clients/starfurniture/sale-items3.php on line 20 here is my updated code: <?php include ('connect/index.php') ?> <?php mysql_connect(localhost, $username, $password); @mysql_select_db($database) or die("Unable to select database"); $query = "SELECT * FROM saleitems"; $result = mysql_query($query); $num = mysql_numrows($result); mysql_close(); echo "<center>Database Output</center><br><br>"; ?> <?php // display results $totalColumns = 5; $i = 1; echo "<table border='0' cellpadding='2'>"; while ($row = mysql_fetch_array($results)){ if ($i == 1) echo "<tr>"; echo "<td>"; echo "<img src=\"$image\"><br>$name<br>$classification<br>$percentoff<br>"; echo "</td>"; if ($i == $totalColumns) { echo "</tr>"; $i = 0; } $i++; } echo "</table>"; ?>
  4. I realize this probably pretty basic but nonetheless I need a point in the right direction .. heres what I got: I currently have it to where the user can input data and it is stored in a mysql db.. I am having problems with the output portion and it being formatted the way I would like it. I want for it to print the all the data results inside of html tables... 5 across (columns) and 2 down (rows) so a total of ten records are printed out. After 10 I want it to generate a second page with the next 10 records.. these records will all be sorted by date.. here is a screen shot.. http://fluxar.com/images/star.jpg here is the code I currently have to print my results.. <?php include ('connect/index.php') ?> <?php mysql_connect(localhost, $username, $password); @mysql_select_db($database) or die("Unable to select database"); $query = "SELECT * FROM saleitems"; $result = mysql_query($query); $num = mysql_numrows($result); mysql_close(); echo "<center>Database Output</center><br><br>"; ?> <table border="1" cellspacing="2" cellpadding="2" align="center"> <tr> <?php $i=0; while ($i < $num){ $image = mysql_result($result, $i, "image"); $name = mysql_result($result, $i, "name"); $classification = mysql_result($result, $i, "classification"); $percentoff = mysql_result($result, $i, "percentoff"); $dateadded = mysql_result($result, $i, "dateadded"); ?> <td><?php echo "<img src=\"$image\"><br>$name<br>$classification<br>$percentoff<br>"; ?></td> <?php $i++; } echo "</tr></table>"; ?> any help on this would be greatly appreciated! thanks
  5. delete from both the list of links and from the folder.. I'm not using a database with this.. since the files were so large (for a php upload - 20-30mb) I'm using a pre-built.. java ftp file upload applet and I did not know how to get this applet to communicate with a mysql database.. so thats why I need the help with just having php do everything without a database..
  6. if this is too vague.. please let me know.. I can give further detail.. thanks!
  7. hey guys.. I am rather new to php and I have a script that I've been trying to put together to accomplish a task for a client of mine.. here is what I have been trying to do: - ability for the client to upload a video typically about 20-30mb in size and it inserts into /ministry/uploads/ folder that i created (i have this built and its working using a java ftp applet) - i will have her name the flv video files by date, ie; 2006-12-26 and 2007-01-05 - on the front-end for her visitors it will show a list of the 20 latest videos, ordered by date, that are in the ministry/uploads/ folder. The list of dates will appear as a hyperlink(like this --> 2006-12-26) (im using a little ajax script that once the link is clicked it will open in a designated content area and a flash video player will play it. Please note i have the ajax script and video player ready to go) - so when she uploads the latest flv video file it will auto delete the oldest the (21st video) I really appreciate any help on this.. I've been trying for a couple weeks , off and on , on how to create this but like I said I'm really new to php.. thanks so much,, hope to hear back
  8. hey thanks guys, really appreciate your help! So it is working now...  when I select the state it pulls in the casino list that corresponds to that state I selected, which is exactly what I was wanting. thanks again!
  9. I am very new to PHP as well as MySQL so I think what I am trying to do is probably rather simple.. but after reviewing several tutorials and such I am unable to do it. What I am trying to do is this: We have a listing of all 50 states in the US... when one state is click, California for example, on that same page (casinos.php) I would like to have all the California Casinos that I have stored in my mysql database dynamically listed below.  I have setup the database table already and have inputted some data to test it with.  Is it possible to do all of this with just one php page?  I can make it work if I made 50 seperate php pages for each state each one drawing from the table where for example state=CA, but this seems like a lot more work that I probably could avoid. Hopefully I dont sound too much like a moron for asking this but I would really like to learn how to do it. Thanks for your help in advance.. if you need any more info, let me know. Sam
×
×
  • 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.