-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Problem is i see no items in the code supplied!
-
[SOLVED] Displaying information in a update form
MadTechie replied to dark22horse's topic in PHP Coding Help
Oh Gezzz if this fails shoot me mysql_fetch_array($result, MYSQL_ASSOC) -
[SOLVED] Check if particular record has been displayed and skip it
MadTechie replied to cheeseus's topic in PHP Coding Help
what about $more_articles = mysql_query("SELECT * FROM az_articles WHERE section = '$rrow[section]' AND (NOT art_id = $rrow[art_id]) ORDER BY art_id DESC",$connect); or make it random (just an idea), without showing current $more_articles = mysql_query("SELECT * FROM az_articles WHERE section = '$rrow[section]' AND (NOT art_id = $rrow[art_id]) ORDER BY RAND()",$connect); -
[SOLVED] Displaying information in a update form
MadTechie replied to dark22horse's topic in PHP Coding Help
opps should be mysql_fetch_array($result, MYSQL_NUM) -
i won't post the name in their but just the id, i assume the items are also in the database!
-
[SOLVED] creating random numbers and adding it to a database
MadTechie replied to runnerjp's topic in PHP Coding Help
OK well you need to add status <?php function addNewUser($username, $password, $email){ $time=time(); if(strcasecmp($username, ADMIN_NAME) == 0) $ulevel=ADMIN_LEVEL; else $ulevel=USER_LEVEL; $key=$this->randomkeys(30); $status = 1; $q="INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', $time, $status,'$key')"; $result = mysql_query($q, $this->connection) or die(mysql_error()); return $result; } ?> -
@Lumio SOLVED means its solved can posting in solved threads
-
[SOLVED] creating random numbers and adding it to a database
MadTechie replied to runnerjp's topic in PHP Coding Help
you didn't add the extra field to your database! -
the reason i changed $id=$_POST['id']; is because were dealing with 2 items and $BasketID is easier to remember than just say $id2
-
[SOLVED] creating random numbers and adding it to a database
MadTechie replied to runnerjp's topic in PHP Coding Help
ok you have a problem in the database.. change to this a display the error <?php function addNewUser($username, $password, $email){ $time=time(); if(strcasecmp($username, ADMIN_NAME) == 0) $ulevel=ADMIN_LEVEL; else $ulevel=USER_LEVEL; $key=$this->randomkeys(30); $q="INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', $time, '$key')"; $result = mysql_query($q, $this->connection) or die(mysql_error()); return $result; } ?> -
[SOLVED] Check if particular record has been displayed and skip it
MadTechie replied to cheeseus's topic in PHP Coding Help
Ahh ok 2 options spring to mind #1, just use random (not ideal) $more_articles = mysql_query("SELECT * FROM az_articles WHERE section = '$rrow[section]' ORDER BY RAND()",$connect); #2, store the ids in a cookie and use NOT IN (note cookie should be comma delimited) $more_articles = mysql_query("SELECT * FROM az_articles WHERE section = '$rrow[section]' AND NOT ID in ($COOKIE) ORDER BY art_id DESC",$connect); it depends on the "rules" what are the "rules" for the more_articles, ie only show once! don't show a link to the current article etc -
[SOLVED] Displaying information in a update form
MadTechie replied to dark22horse's topic in PHP Coding Help
try <?php print_r($_GET); $id=$_GET['id']; //connect to mysql //change user and password to your mySQL name and password mysql_connect("localhost","root",""); //select which database you want to edit mysql_select_db("car"); $query = "select * from car WHERE id = '$id' "; $result = mysql_query($query); $num = mysql_num_rows($result); $i = 0; while ($i<$num) { $row = fetch_array($result); $price = $row['price'] $description= $row['Description']; $photo= $row['Description']; $photo1= $row['photo1']; $photo2= $row['photo2']; $photo3= $row['photo3']; $car_of_the_week= $row['car_of_the_week']; $status1= $row['status1']; $id=$_GET['id']; ?> <html> <body> <form enctype="multipart/form-data" action="uploader2.php" method="POST"> <table width='100%' border='1'> <tr> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> <td>ID</td> <td><input type='text' name='id' value='<?php print "$id";?>'> </td> <td>Price</td> <td><input type='text' name='price' value='<?php print "$price";?>'> </td> <td>Description</td> <td><input type='text' name='description' value='<?php print "$description";?>'> </td> <td>Photo</td> <td><input name="photo" type="file" value='<?php print "$photo";?>'> </td> <td>Photo1</td> <td><input name="photo1" type="file" /></td> <td>Photo2</td> <td><input name="photo2" type="file" /></td> <td><input name="photo3" type="file" /></td> <td>Car of the Week</td> <td><input type="text" name="car_of_the_week" length="20" value ='<?php print "$car_of_the_week";?>'></td> <td>Status</td> <td><input type="text" name="status1" length="20" value = "jjjj"/></td> <td><input type="submit" value="Upload Files" /></td> </tr> </table> </form> <? ++$i; } ?> </BODY> </html> -
and how does that affect the changes i made ?!!
-
[SOLVED] Check if particular record has been displayed and skip it
MadTechie replied to cheeseus's topic in PHP Coding Help
in which i don't understand your question -
OK well this is the part i think you mean <?php $id=$_POST['id']; $db=mysql_connect("localhost","basket","PASSWORD"); mysql_select_db("college",$db); $query="INSERT INTO basket (item_id, basket_id) values (".$id.", 2)"; mysql_query($query, $db); ?> in the form <table width="550" border="0" align="center"><tr><td width="118"><table width="550" border="0" align="center"> <tr> <td width="94"><img src="Images/action1.jpg" width="90" height="151" /></td> <td width="446"><p>DEJAVU</p> <form id="form1" name="form1" method="post" action=""> <label> <input type="submit" name="Submit" value="Buy" /> <input name="Itemid" type="hidden" id="Itemid" value="1" /> <input name="Basketid" type="hidden" id="Basketid" value="2" /> </label> </form> <p> </p></td> </tr> and update <?php $Itemid=$_POST['Itemid']; $Basketid=$_POST['Basketid']; $db=mysql_connect("localhost","basket","PASSWORD"); mysql_select_db("college",$db); $query="INSERT INTO basket (item_id, basket_id) values ($Itemid, $Basketid)"; mysql_query($query, $db); ?>
-
The source isn't displayed.. the server process the script and displays the results.. so in your script the source will NOT show the password
-
mysq manual is a good place to start:)
-
eval isn't allowed on alot of online servers also whats publisher pro 1.1 got to do with it.. if its not on your hosts server you can't use it anyways!
-
[SOLVED] creating random numbers and adding it to a database
MadTechie replied to runnerjp's topic in PHP Coding Help
<?php function addNewUser($username, $password, $email){ $time=time(); if(strcasecmp($username, ADMIN_NAME) == 0) $ulevel=ADMIN_LEVEL; else $ulevel=USER_LEVEL; $key=$this->randomkeys(30); $q="INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', $time, '$key')"; return mysql_query($q, $this->connection); } ?> if this doesn't work then whats the error.. -
your need to show some code as doesn't make much sense if yo have don't it with the id then its the same thing!
-
how are you storeing the cart data ? Cookies session database etc ? can you post what you have so far.. if you are using a database just lookup the item id in the database and pull the name
-
yeah noticed that but error check is always worth adding
-
[SOLVED] Check if particular record has been displayed and skip it
MadTechie replied to cheeseus's topic in PHP Coding Help
I didn't read the whole thing but.. use limit like this LIMIT start, end so LIMIT 0,5 - displays the first 5 LIMIT 5,5 - displays the next 5 (records 5 to 10) LIMIT 10,5 - displays the next 5 (records 10 to 15) etc -
The saying i use is kinda the same no matter how idiot proof you make your software someone will make a better idiot
-
change <?php $result1 = mysql_query("SELECT * FROM recipe WHERE name LIKE '%$search%' OR desc LIKE '%$search%'"); ?> to <?php $result1 = mysql_query("SELECT * FROM recipe WHERE name LIKE '%$search%' OR desc LIKE '%$search%'") or die(mysql_error()); ?> any errors ?