Jump to content

Pauls74462

Members
  • Content Count

    50
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Pauls74462

  • Rank
    Newbie
  • Birthday 02/02/1958

Previous Fields

  • Languages
    HTML

Contact Methods

  • Website URL
    http://hotimagez.net
  • ICQ
    0
  • Yahoo
    hotimagez

Profile Information

  • Location
    OK -- USA
  • Interests
    Leaning PHP / MySQL
  1. Pauls74462

    Get data PHP

    Clicking email does not work.
  2. Pauls74462

    Get data PHP

    Below is a PHP code I found to get data from MySQL and show db info on a web page. What I like to do is to make the email link where I can click on it and send an email. What I need to know is what php line needs to be edited and how do I add the "mailto:" to the email address.The code live working can be seen at: http://softsevenorg.com/MySQL/GetTables.php <html><head><title>MySQL Table Viewer</title></head><body><?php$db_host = 'localhost';$db_user = 'root';$db_pwd = 'lptm42b';$database = 'sphinx';$table = 'spheres';if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database");if (!mysql_select_db($database)) die("Can't select database");// sending query$result = mysql_query("SELECT * FROM {$table}");if (!$result) { die("Query to show fields from table failed");}$fields_num = mysql_num_fields($result);echo "<h1>Table: {$table}</h1>";echo "<table border='1'><tr>";// printing table headersfor($i=0; $i<$fields_num; $i++){ $field = mysql_fetch_field($result); echo "<td>{$field->name}</td>";}echo "</tr>\n";// printing table rowswhile($row = mysql_fetch_row($result)){ echo "<tr>"; // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row as $cell) echo "<td>$cell</td>"; echo "</tr>\n";}mysql_free_result($result);?></body></html> PS. The MySQL connections info in the above file is NOT the current info.
  3. Pauls74462

    Id reset

    The array sounds like a good option, but what is the code for it?
  4. Pauls74462

    Id reset

    Here is how I choose a random users, is there a better way?$result = mysql_query("SELECT * FROM MyTable"); $Choose_rows = mysql_num_rows($result); $Num2Use = rand(1, $Choose_rows);$result = mysql_query("SELECT * FROM Members where id = $Num2Use");
  5. Pauls74462

    Id reset

    I have a db and when I delete a row then my Id numbers get out of sink. How to I keep the rows in numeral order after delete of a rod have been done?I need the Id to be in numerical so I can do a random function.Paul
  6. Can you give me a sample code of the one step?
  7. Can someone tell me what is wrong with the below code?<?php// If file existsif file_exists("testFile.txt"); // Do somethingelse $ourFileName = "testFile.txt"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); fclose($ourFileHandle);?>
  8. Just at the time of the testing, I will have that table filled up data I hope in time.I later put some fake data in it to test, it works as wanted.
  9. Don't know if it will work, I only have 1 row in my db now, but with the 1 row it works. No sorting is needed.Thanks for all who posted help! $result = mysql_query("SELECT * FROM Members"); $num_rows = mysql_num_rows($result); $NewNum = rand(1, $num_rows);$result = mysql_query("SELECT * FROM Members where ID = $NewNum");
  10. I have the below code or at least a start. I need to select a random row <?php // Get db connectionsinclude ("config.php");// Make a MySQL Connection$link2 = mysql_connect( $dbhost, $dbuser, $dbpass)or die("Could notconnect: ".mysql_error());mysql_select_db($dbname) or die(mysql_error());// Query the database and get the count $result = mysql_query("SELECT * FROM Members"); $num_rows = mysql_num_rows($result); $NewNum = rand(1, $num_rows);$sql = "SELECT * FROM Members WHERE somefield='something' ORDER BY RAND() LIMIT 1"; // select random row?>
  11. I went there, no help
  12. How do I make a mouseover bold hyperlink: while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td width='25'>"; echo "<p align='center'>" . $row['id'] . "</td>"; echo "<td width='1000'>"; echo "<a href=" . $row['Domain'] . ">" . $row['Domain'] . "</a></td>"; //Bold mouseover link here echo "<td width='75'>"; echo "<p align='center'>" . $row['City'] . "</td>"; echo "<td width='25'>"; echo "<p align='center'>" . $row['State'] . "</td>"; echo "<td width='25'>"; echo "<p align='center'>" . $row['Zip'] . "</td>"; echo "</tr>"; }echo "</table>";
  13. Please give code sample, this css thing is all new!
  14. while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td width='25'>"; echo "<p align='center'>" . $row['id'] . "</td>"; echo "<td width='1000'>"; echo "<a href=" . $row['Domain'] . ">" . $row['Domain'] . "</a></td>"; // How do I make this link BOLD when the mouse in over? echo "<td width='75'>"; echo "<p align='center'>" . $row['City'] . "</td>"; echo "<td width='25'>"; echo "<p align='center'>" . $row['State'] . "</td>"; echo "<td width='25'>"; echo "<p align='center'>" . $row['Zip'] . "</td>"; echo "</tr>"; }echo "</table>";
  15. Would this make the link bold?h3 a:hover { text-decoration: bold; font-size: 1em;color:#800;}
×
×
  • Create New...