Jump to content

BillyBoB

Members
  • Posts

    630
  • Joined

  • Last visited

    Never

Everything posted by BillyBoB

  1. that is just to backup i saw that on my research too. Plus php is very flexible so with the php file you can easily use a form to change the table name and the saved file name. either way.
  2. The below code is how to backup the database [code]<?php $tableName  = 'mypet'; $backupFile = 'backup/mypet.sql'; $query      = "SELECT * INTO OUTFILE '$backupFile' FROM $tableName"; $result = mysql_query($query); ?>[/code] The below code is how to Restore a backup [code]<?php $tableName  = 'mypet'; $backupFile = 'mypet.sql'; $query      = "LOAD DATA INFILE 'backupFile' INTO TABLE $tableName"; $result = mysql_query($query); ?>[/code]
  3. well without looking at the rest of the coding i would have to guess that the style in the form has been posted so its following the rest of the code [code] Redirect(0,"blog.php"); [/code] without seeing the rest i cant really help but i hope this helps
  4. none u say wat about the [code]$result = mysql_query($query) or die(mysql_error());[/code] ?? because usually or die(mysql_error()); is printed onto the screen?...
  5. this is supposed to be a bandaid but try puting this at the very beginning... [code] ob_start(); [/code]
  6. Is there a way to access the mysql database though a different site becuase my friend has a website http://hateandrage.com and it doesnt have mysql but mine does so i was wondering if i could use a database off of my site for his site...
  7. ok sorry i cant help u there i dont know
  8. This really isn't the correct spot to post this.
  9. *NOTE: ~ means simular i dont think i get the exact thing here do u want to know if they are ~ or do u want to define the difference? if u want to see if they are ~ then just do like [code] <?php If($var1==$var2) {   echo("They are the same."); }else{   echo("They aren't the same."); } ?> [/code]
  10. i think the best way of doing this would be: [code] <?php $query = mysql_query("SELECT * FROM user"); while($user = mysql_fetch_assoc($query)) {   $to = $user['email'];   $subject = "This is the subject";   $message = "This mail is going out to all my members...";   $headers = "From: NOREPLY@blabla.com\r\n" .   'X-Mailer: PHP/' . phpversion() . "\r\n" .   "MIME-Version: 1.0\r\n";   mail($to, $subject, $message, $headers)or die('The email could not send!'); } ?> [/code]
  11. dude u have 106 posts or so and u still use This is agrivating as a title ... -_- not good not good at all
  12. actually i have to problem with this site i dont know why it wouldnt work
  13. then your not defining the varible $path
  14. have u defined the $path??? try this i know wat went wrong there [code] <?php Echo(" #topnav  { background:url($path/includes/teal.gif) repeat-x; padding-top:5px; color:#fff; } "); ?> [/code]
  15. ok try [code] #topnav  { background:url(<?php$path?>/includes/teal.gif) repeat-x; padding-top:5px; color:#fff; } [/code]
  16. try this i dont know if it will work [code]<?php  $database="mydatabase";  mysql_connect ("localhost", "user", "pass");  @mysql_select_db($database) or die( "Unable to select database"); $sql = mysql_query("select * from windows_atari2600 where emulator = '$_POST[emusearch]'"); if($sql==""){ while ($get_info = mysql_fetch_row($sql)) {    echo "<tr>";    foreach ($get_info as $field) echo "<td>$field</td>\n";   echo "</tr>\n"; } }else{   echo "<tr>";   echo "We cannot find your infomation.";   echo "</tr>\n"; } ?>[/code]
  17. i think i have replied to this b4 you do not get the posted info just by say $emusearch here is how it should be ... [code] <?php  $database="mydatabase";  mysql_connect ("localhost", "user", "pass");  @mysql_select_db($database) or die( "Unable to select database"); $sql = mysql_query("select * from windows_atari2600 where emulator = '$_POST[emusearch]'"); if(isset($sql)){ while ($get_info = mysql_fetch_row($sql)) {    echo "<tr>";    foreach ($get_info as $field) echo "<td>$field</td>\n";   echo "</tr>\n"; } }else{   echo "<tr>";   echo "We cannot find your infomation.";   echo "</tr>\n"; } ?> [/code]
  18. [code]<?php $result = mysql_query('SELECT name, sitelink, sitedownload, dateadded, publisher FROM site ORDER BY name DESC'); print "<table border=1 class=list>"; echo("<thead><tr><td>Site Name</td><td>Site Link</td><td>Site Download</td><td>Date Added</td><td>Publisher</td></tr></thead><tbody>"); while ($qry = mysql_fetch_array($result)) { print "<tr>"; print "<td>$qry[name]</td>"; print "<td><a href=$qry[sitelink]>$qry[sitelink]</a></td>"; print "<td><a href=$qry[sitedownload]>$qry[sitedownload]</a></td>"; print "<td>$qry[dateadded]</td>"; print "<td>$qry[publisher]</td>"; print "</tr>"; } print "</tbody></table>"; ?>[/code] test b4 u say its wrong
  19. create if commands and if that one is clicked then make a new mysql_query to get then info out and include ORDER BY ..... DESC like $result = mysql_query('SELECT name, sitelink, sitedownload, dateadded, publisher FROM site ORDER BY dateadded DESC'); i have one question is name sitelink sitedownload dateadded and publisher all the info in the db site because if so then all u have to do is $result = mysql_query('SELECT * FROM site ORDER BY dateadded DESC'); * means all
  20. but if there is no info then it will error up so try [code] <?php $database="mydatabase"; $emusearch = $_POST['emusearch']; mysql_connect ("localhost", "user", "pass");  @mysql_select_db($database) or die( "Unable to select database"); $sql = mysql_query("select * from windows_atari2600 where emulator = '$emusearch'"); if(isset($sql)){ while ($get_info = mysql_fetch_row($sql)) {    echo "<tr>";    foreach ($get_info as $field) echo "<td>$field</td>\n";   echo "</tr>\n"; } }else{   echo "<tr>";   echo "We cannot find your infomation.";   echo "</tr>\n"; } ?> [/code]
  21. now seeing as the name of the textbox is emusearch it would be $_POST['emusearch'] you dont have to connect to the db on the first page now correct me if im wroung i havnt been doing php for a while the $field is the info you searching for and the $get_info is the info your searching through if so then put $field = $_POST['emusearch']; b4 the $database="mydatabas";
  22. in this code do u have a part to check if the pass is correct if so then show me the part
  23. will u plz put your code in a code box its as ez as pressing a button or typeing [ code ] and [ /code ] without the spaces
  24. yea same thing i just havnt been doing php for a while sorry ive been doing vb
  25. idk try : [code] <?   $firstname = $_POST['firstname'];   $lastname = $_POST['lastname'];   $email = $_POST['email'];   $phonenumber = $_POST['phonenumber'];   $homeaddress = $_POST['homeaddress'];   $citystate = $_POST['citystate'];   $country = $_POST['country'];   $domainname = $_POST['domainname'];   $username = $_POST['username'];   $password1 = $_POST['password1'];   $password2 = $_POST['password2'];   $rules = $_POST['rules'];   $legalinfo = $_POST['legalinfo'];   $age = $_POST['age'];   $sitedetails = $_POST['sitedetails'];   $aboutus = $_POST['aboutus'];   if ($firstname == "") { echo "First Name field was left blank.<br />"; error = 1}   if ($lastname == "") { echo "Last Name field was left blank.<br />"; error = 1}   if ($email == "") { echo "Email Address field was left blank.<br />"; error = 1}   if ($phonenumber == "") { echo "Phone Number field was left blank.<br />"; error = 1}   if ($homeaddress == "") { echo "Home Address Field was left blank.<br />"; error = 1}   if ($citystate == "") { echo "City&State field was left blank.<br />"; error = 1}   if ($country == "") { echo "Country field was left blank.<br />"; error = 1}   if ($domainname == "") { echo "Your Domain field was left blank.<br />"; error = 1}   if ($username == "") { echo "Desired Username field was left blank.<br />"; error = 1}   if (($password1 == "") || ($password2 == "") || ($password1 != $password2)) { echo "Password fields were left blank or do not match.<br />"; error = 1}   if ($rules == "") { echo "You didn't agree to the rules.<br />"; error = 1}   if ($legalinfo == "") { echo "You didnt agree to the legal information.<br />"; error = 1}   if ($age == "") { echo "You didnt state you were over the age of 18.<br />"; error = 1}   if ($sitedetails == "") { echo "Site Details field was left blank.<br />"; error = 1}   if ($aboutus == "") { echo "About Us field was left blank.<br />"; error = 1}   if error = "" {     echo "Works, all clear.";   } ?>[/code] my guess would be that when u said else it was only refering to the $aboutus string...
×
×
  • 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.