Jump to content

jugesh

Members
  • Posts

    38
  • Joined

  • Last visited

jugesh's Achievements

Newbie

Newbie (1/5)

2

Reputation

  1. Mysql takes date as YYYY-MM-DD format, If your date column is Date type If you want to insert date in date("m.d.y") format make date column as varchar
  2. Hi mdemetri2, It has nothing to do with HTTPS... you can write the sql to generate data and put it in adRow function eg: $csv = new CSV(array('Col1', 'Col2',......)); while($row=mysql_fetch_array($res)){ $csv->addRow(array($row["Col1"], $row["Col2"])); }
  3. Your question is somewhat confusing for me... Do u want to save the values in DB?
  4. $div = mysql_real_escape_string($_POST['contents']); // Make sure to clean the // data before putting SQL $sql = "INSERT INTO divs (contents) VALUES ('{$div}')";
  5. here is a class to create CSV class CSV { protected $data; /* * @params array $columns * @returns void */ public function __construct($columns) { $this->data = '"' . implode('","', $columns) . '"' . "\n"; } /* * @params array $row * @returns void */ public function addRow($row) { $this->data .= '"' . implode('","', $row) . '"' . "\n"; } /* * @returns void */ public function export($filename) { header('Content-type: application/csv'); header('Content-Disposition: attachment; filename="' . $filename . '.csv"'); echo $this->data; die(); } public function __toString() { return $this->data; } } $csv = new CSV(array('Col1', 'Col2',......)); $csv->addRow(array('Val1', 'Val2',...));
  6. end of every statement check ; is there or not?
  7. ini_set('include_path', '/home/content/a/i/o/est/html/');
  8. create a php file and write the command: <? echo phpinfo()?> upload file on server and run the file to check php settings to get the path
  9. You Query: $u = "UPDATE player_registration SET `name`='$_POST[inputname], `surname`='$_POST[inputsurname], `contact_number`='$_POST[inputcontact]', `email`='$_POST[inputemail]', `position`='$_POST[inputpos]', `username`='$_POST[inputusername]', `password`='$_POST[inputpassw]' WHERE ID = $_POST[player_id]"; mysql_query($u) or die (mysql_error()); check colored part one quote is missing. rectify it to: $u = "UPDATE `player_registration` SET `name`='$_POST[inputname], `surname`='$_POST[inputsurname]', `contact_number`='$_POST[inputcontact]', `email`='$_POST[inputemail]', `position`='$_POST[inputpos]', `username`='$_POST[inputusername]', `password`='$_POST[inputpassw]' WHERE ID = $_POST[player_id]"; mysql_query($u) or die (mysql_error());
  10. echo query and run query in phpmyadmin u wl come to know if there is any error
  11. It seems your file is not getting proper path.Check php ini and set the folder path.
  12. $sql = "Your Query"; $result = mysql_query($sql) or die(mysql_error()); $numRes=mysql_num_rows($result); if($numRes>0){ echo "Sorry, that user already exists."; exit(); }
  13. $sql="SELECT * FROM users Where userid ! ='your_user_id' ORDER BY username";
×
×
  • 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.