sasa
Staff Alumni-
Posts
2,804 -
Joined
-
Last visited
-
Days Won
1
Everything posted by sasa
-
cnange list($email,$password) = explode(" ",$b); to list($email,$password) = explode(" ",trim($b));
-
cen you post 3 lines of code before this line
-
can you post your form code
-
.change $brandID = $this->input->post('brand[]'); to $brandID = $this->input->post('brand');
-
change $insert = "UPDATE `users` (`UID`, `PWD`) VALUES ('{$_POST['UID']}', '{$_POST['PWD']}') WHERE `ID` =$_POST['ID']"; to $insert = "UPDATE `users` (`UID`, `PWD`) VALUES ('{$_POST['UID']}', '{$_POST['PWD']}') WHERE `ID` =$_POST['ID']";
-
change line if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) { to if (!$_POST['username'] || !$_POST['pass'] || !$_POST['pass2'] ) {
-
passing a value from one form to another:need help
sasa replied to esandra's topic in PHP Coding Help
change this part of code <?php if(isset($_POST['godate'])){ $today=$_POST['today']; $query="SELECT DISTINCT tcl FROM arrastre WHERE today='$today' ORDER BY tcl ASC"; $result=mysql_query($query); while($row=mysql_fetch_array($result)){ $tcl=$row['tcl']; $today=$row['today']; ?> <input type="hidden" name="tcl" value="<?php echo $tcl;?>"> <input type=submit name="tcl" value="<?php echo $tcl; ?>"> <?php } } ?> with <?php if(isset($_POST['godate'])){ $today=$_POST['today']; $query="SELECT DISTINCT tcl FROM arrastre WHERE today='$today' ORDER BY tcl ASC"; $result=mysql_query($query); echo '<form method="POST"><input type="hidden" name="today" value="', $today, '">'; while($row=mysql_fetch_array($result)){ $tcl=$row['tcl']; $today=$row['today']; ?> <input type="submit" name="tcl" value="<?php echo $tcl; ?>"> <?php } } ?> </form> -
select COUNT(ID) AS num_of_rows from data this return just number of data (one row)
-
http://php.net/manual/en/ref.mysql.php
-
UNIX_TIMESTAMP(STR_TO_DATE(`date`,'%W %b %D %Y @ %h:%i %p'))
-
SQL looks OK for me
-
~^[^-][a-z0-9\-]{1,}[^-](\.[^-][a-z0-9\-]{1,}[^-])?$~D
-
ttry <?php $test = '/holdcroft-renault-hanley/used-cars/2/4/price-asc/'; $a = perm($test); print_r($a); function perm($a){ $out = array(); $a = explode('/', trim($a, '/')); $a1 = $a; if ($a[0] ){ while (count($a)){ $out[] = '/'. implode('/', $a).'/'; array_pop($a); } array_shift($a1); $c = perm(implode('/', $a1)); $out = array_merge($out, $c); } return $out; } ?>
-
use thi SQL code SELECT jobs.id, jobtext, jobdate, name FROM jobs LEFT JOIN author ON author.id=jobs.authorid
-
How to Display an Array Horizontally in A Set Number of Rows?
sasa replied to Modernvox's topic in PHP Coding Help
try <?php // Print out result while($row = mysql_fetch_array($result)){ echo "There are ". $row['COUNT(biddersId)'] ." bidders logged."; echo "<br />"; } $query = "SELECT * FROM bidders ORDER BY biddersId"; $result = mysql_query($query) or die(mysql_error()); echo "<table border='1'>"; echo "<tr>", str_repeat("<td>Bidders</td>",3), "</tr>\n"; // keeps getting the next row until there are no more to get $i=0; while($row = mysql_fetch_array( $result )) { if ($i == 0) echo "<tr>"; $i++; // Print out the contents of each row into a table echo "<td>"; echo"<font face= \"calibri\" size=\"3\">"; echo $row['biddersId']; echo "</font>"; echo "</td>"; if ($i == 3){ echo "</tr>\n"; $i=0; } } if ($i>0){ while ($i++ <3) echo '<td> </td>'; echo "</tr>\n"; } echo "</table>"; ?> -
time return number of seconds from jan 1st 1971 to now jan 1st 1971 is thusday and i add 3 days (3*7*24*3600) to move to monday as start ofr week
-
<?php //echo date('D', strtotime('71/1/1')); $staff = array('Branda', 'Tara', 'Tom'); echo $staff[((time()+3*24*3600)/(7*24*3600)) % 3]; ?>
-
<?php $test = '<a href="test.test"></a>'; $test = preg_replace('/^.*(href="[^"]*").*$/','$1',$test); Echo $test; ?>
-
Warning: Invalid argument supplied for foreach()
sasa replied to MasterACE14's topic in PHP Coding Help
can you post your form code -
Parse error: syntax error, unexpected T_STRING in C:\blablah on line 31
sasa replied to Namtip's topic in PHP Coding Help
<?php //let's start our session, so we have access to stored data session_start(); include 'db.inc.php'; $db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or die ('Unable to connect. Check your connection parameters.'); mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db)); //let's create the query $query = 'INSERT INTO subscriptions (name, email_address, membership_type, terms_and_conditions, name_on_card, credit_card_number, credit_card_expiration_data) VALUES ( "' . $_SESSION[$name] . '", ' . $_SESSION[$email_address] . '", ' . $_SESSION[$membership_type] . '", ' . $_SESSION[$terms_and_conditions] . '", ' . $_POST[$name_on_card] . '", ' . $_POST[$credit_card_number] . '", ' . $_POST[$credit_card_expiration] . ')'; if (isset($query)) { $result = mysql_query($query, $db) or die(mysql_error($db)); } ?> <p>Done!</p> </body> </html> ?> -
1st and 3rd are same (parse error)
-
$patern = '/<div class="spoiler"><input type="button" onclick="showSpoiler\(this\);" value="Show\/Hide" \/><div class="inner" style="display:none;">(.+?)<\/div><\/div>/is';
-
try to change $sql = "SELECT * FROM users WHERE uid=".$uid; with $sql = "SELECT * FROM users WHERE uid='".$uid."'";
-
change this lines $loop = (int)(count($vendors_states) / 5); if(count($vendors_states) % 5 > 0) $loop++; with $loop = count($vendors_states);
-
$message = "This is to confirm that the following message was sent to our sales department:\n\n" + $message; you mean dot not plus $message = "This is to confirm that the following message was sent to our sales department:\n\n" . $message;