PHP - Auto_increment Problem
Hello, how can i reset Auto_increment to 0? because i've made some tests with my database and now may entrys start from value 19..
Similar Tutorialshow can i have 2 AUTO_INCREMENT colloums ? i need my id column and my position column to Auto increment. i cant use the id column to set my position as i need to change the val and as i no u cant change ur prim key auto increment column ???? so any forts how i can get a drop down list box to show the content of column `position` (in format 1,2,3,4,5,6,7ect ) and auto increment when adding a new project. my idea when adding is to get the form page to read the bottom of the `position` column for the number and then add one and set that val to a read only text field on the project add page. is there an easy or better way to do this and how would one go about doing this ??? as im a noobie but getting there how-tos or code samples will help a lot people and im wanting to learn as well so any good php tutorial sites send them ,my way thanks My question is basically this: If I'm building a submission form - which places info into my DB via a mySQL query (INSERT INTO) - is there also a way to reference the id that it is creating? The form is set to just dump raw data into a database - each submission enters data into at least 8 DB tables which are all tied together by an $id row in each table. My query references those $id rows in each table to build a query. After each query is completed, a unique url (which is stated by the submitter in the form of /example/someotherword/) is generated. I need to find a way to place some sort of script within a page that displays the results based on each $id. So, lets say that the url is clicked, it would take you to a page that displays the results - but only does so based on the reference to that urls unique $id within the table. I'll provide code once I get home, but if you guys have any ideas that would be great. Guys thanks for helping me solve the problem i had but now i have another problem and i am lost. i have included the code below for you to have overview.
This is the code:
<table style="width:100%; margin-left:auto; margin-right:auto"> I'm trying to run a process using shell_exec, however the program i'm trying to run must communicate with a process that is not a system process, and everytime i run it, it fails, does anyone know how to make a apache/php server run active windows not in the system process? Im trying to parse this string and put it in the array.. However i dont know how.. Code: [Select] 11111<>your mobile<>the receiver<>keyword<>2012-01-15<>12:09:08<>wow "this", is great! I want to remove this sign <> and put the elements on the array.. Also i would not want to loose the quotes and commas Can someone help me? thanks Hi everyone. I have written a PHP script gets data from a MySQL database and attempts to convert it to an RSS feed. The problem I am having is that when I preview the feed the "article_type", "article_author", "article_author2" and "article_company" information is not showing up in the feed. Have I coded this wrong? Thanks for any help. while($rss_array = mysql_fetch_array($rss_rs)) { $xml .= "<item><title><![CDATA[" . $rss_array['article_title'] . "]]></title> <link><![CDATA[index.php?skip=true&article=" . $rss_array['article_number'] . "]]></link><guid><![CDATA[index.php?skip=true&article=" . $rss_array['article_number'] . "]]></guid><description><![CDATA[" . str_replace("'", "", $rss_array['article_description']) . "]]></description> <article_type>" . $rss_array['article_type'] . "</article_type> <article_author>" . $rss_array['article_author'] . "</article_author> <article_author2>" . $rss_array['article_author2'] . "</article_author2> <article_company>" . $rss_array['article_company'] . "</article_company> </item>"; } im trying to get this code to determine whether or not the form entered had anything in it, and if it doesn't show an error message and redirect the user back to the form. and if it does have content sumbit it. the problems i've had so far is either it will display the message, and submit the empty form or just not work at all. ill attatch the entire code. Code: [Select] <?php $msg=fopen('data1.txt','r'); $read=fgets($msg); print "\""; echo $read; print "\""; fclose($msg); ?> <?php $submit = $_REQUEST['submit']; $data = $_POST['data']; $file = "data1.txt"; $fp = fopen($file, "w") or die("ohno something went wrong"); if(empty($data)) { echo "no text entered, redirecting... or click <a href=\"index.php\">here</a><meta http-equiv=\"refresh\" content=\"3;url=index.php\" />"; } else($submit == 1) { fwrite($fp, $data); fclose($fp); echo "post submitted, redirecting... or click <a href=\"index.php\">here</a><meta http-equiv=\"refresh\" content=\"3;url=index.php\" />"; } ?> <form name="form" method="post" action="index.php?submit=1"> <textarea name="data" rows="4"></textarea> <input type="submit" value="write" /> </form> Hello everyone Just found this forum and really need some help. I'm trying to create a popup contact form for my product pages. I managed to get a php form from a random site and i cant get the form to pop up. http://www.e-sol.co.uk/printer-scanner-copier.php If someone could help i would be very grateful. Hi Guys, I am having an issue with an if statement, I cant get it to go true, even though it clearly is! Please excuse the messy code, im pulling my hair out here! $itemprice[0] = 8.99; $itemprice[1] = 19.95; $itemprice[2] = 8.99; print_r($itemprice); echo "<BR>"; $x=0; foreach($itemprice AS $val) { echo gettype($val) .$val. "<br>"; if($val == 8.99) { $x++; $freecount++; } } echo $x; outputs correctly: Array ( => 8.99 [1] => 19.95 [2] => 8.99 ) double8.99 double19.95 double8.99 x = 2 replacing: $newtotal = add_to_price($id, $non_disc); $itemprice[] = $newtotal - $non_disc; print_r($itemprice); echo "<BR>"; $x=0; foreach($itemprice AS $val) { echo gettype($val) .$val. "<br>"; if($val == 8.99) { $x++; $freecount++; } } echo $x; The add to price function returns a running total, the take away gives me the current item price in a for loop to build the array. Output: Array ( => 8.99 [1] => 19.95 [2] => 8.99 ) double8.99 double19.95 double8.99 x = 1 The problem? Well when I build the array up automatically it still prints the same, has the same datatype, yet the if statement does not catch the second 8.99 value? Please accept my apologies for this post, it is my first ever and i've been doing this for 10 years now, i have never been this stumped on something so simple, I can only think it is a datatype error but i have tried apostrophes in the if, make no difference. All help massively gratefully received. Please email me if you want to see it in action... Hopefully people here know an easy solution to a problem I'm having. First of all, I'm using a script in Wordpress to retrieve the current url. Then I use a code in a link, adding a little code after it, which would switch the theme of my Wordpress (basically, "currenturlcode&wptheme=Sidebar%20disabled"). It works great, thanks to that, people will remain on the same page they are and switch the theme. However, if that is clicked on the main page, it goes to the 404 page, cause it needs to use "?" instead of "&" in case of that. So what I need help with here, is somehow making my link see if they are on the main page, and if so, adding "?wptheme=Sidebar%20disabled" there, on other cases"&wptheme=Sidebar%20disabled". i have written a script using touch() function for creating new pages.. but the url's appear are not search engine frendly i want the urls to appear like this everyspace filled with - oder than a space because the space makes the url display as http://localhost/gl/uploads/movies/2010/08/The%20Hangman%202010%20Hindi%20Movie%20Watch%20Online/The%20Hangman%202010%20Hindi%20Movie%20Watch%20Online.php I want it to appear this way http://www.onlinewatchmovies.net/hindi/vroom-2010-hindi-movie-watch-online.html any suggestion how can i do this? I have a simple text file called bio.txt: Code: [Select] wohlersr; Richie Wohlers; Intermediate; Four Aces meyersg; Greg Meyers; Novice; Four Aces I wrote a little script, to return the info for Greg Meyers if the user id is correct, or say "Member not found" if incorrect. For some reason, my output is giving me both. I assume it's a context error, but can't figure it out. Here's my script: Code: [Select] <?php $file=file("bio.txt"); $count=count($file); $i=0; while($i<=$count) { $row = explode(";", $file[$i]); $id = $row[0]; $name = $row[1]; $class = $row[2]; $club = $row[3]; if($id=="meyersg"){ echo $name."</br>"; echo $class."</br>"; echo $club."</br>"; }else{ echo "Member not found."; } $i++; } ?> And here's the output I'm getting: Code: [Select] Member not found. Greg Meyers Novice Four Aces Member not found. You may see a lot of things wrong with the code below, but please bring it to my attention! I'm trying to advance my knowledge on OOP, but I'm trying my best to get the basics down. The below code, after selecting the two characters to fight, the page returns nothing, just blank. I'm pretty sure the error lyes within class_li.php, but I'm not exactly sure. Script is attached. hello! I have a problem with utf-8 ...
In horizontalmenu.php I have:
print '<a href="/calcioitalia/coaches/'.$name.'.html').'">'.$name.'</a>';where $name=José Márioand in .htaccess I have AddDefaultCharset UTF-8 AddCharset UTF-8 .htmland doesn't work... How could I solve this problem? Thank u! I do not receive email for my published php file which is: <?php ///// easend.php ///// $youremail = "acdelco40108@yahoo.com"; /*put the email address here, between quotes, the email address you want the message sent to*/ $to = $youremail; $email = $_POST['EMail']; $name2 = $_POST['Name']; $street2 = $_POST['Street']; $city2 = $_POST['City']; $state2 = $_POST['State']; $zip2 = $_POST['Zip']; $Phone = $_POST['Home_Phone']; $Cell = $_POST['Cell_Phone']; $education = $_POST['email1']; $comments = $_POST['email2'] ; $headers = "From:" . $email; $fields = array(); $fields{"Name"} = "Name"; $fields{"Street"} = "Street"; $fields{"City"} = "City"; $fields{"State"} = "State"; $fields{"Zip"} = "Zip"; $fields{"Home_Phone"} = "Home Phone"; $fields{"Cell_Phone"} = "Cell Phone"; $fields{"EMail"} = "Email"; $fields{"email1"} = "Education"; $fields{"email2"} = "Comments"; $subject = "We have received the following information from your employment application"; $body = "We have received the following information from your employment application:\n\n"; foreach($fields as $a => $b) { $body .= sprintf("%20s: %s\n",$b,$_POST[$a]); } mail ($to, $subject, $body, $headers); //send mail to owner #end create email vars $headers = "From:" . $to; mail ($email, $subject, $body, $headers); //send mail to user #end create email vars echo "<head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"2; URL=ThankYou.html\"></head>"; ?> Hey guys i just installed a new Theme on my IPB 3.3.4 its called Dashboard now, the start page looks fine but if i try to click on "My Profile" an error pops up.
Error message:
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\board\cache\skin_cache\cacheid_4\skin_profile.php on line 1035
skin_profile.php on line 1035:
<span class='ipsType_smaller desc lighter blend_links'><a href='" . $this->registry->getClass('output')->formatUrl( $this->registry->getClass('output')->buildUrl( "app=members&module=profile&section=status&type=single&status_id={$status['status_id']}", "public",'' ), "array($status['member_id'], $status['members_seo_name'])", "members_status_single" ) . "'>{$this->lang->words['ps_updated']} " . $this->registry->getClass('class_localization')->getDate($status['status_date'],"manual{%d %b}", 0) . " · " . intval($status['status_replies']) . " {$this->lang->words['ps_comments']}</a></span>
Hi all. When I typed symbol ' in my textarea , after I submit it and view for what I typed , it will automatically add a slash in front of the ' . Such as the message is "I'm fine" , then it will turn out as "I\'m fine". Can I know what is the problem ? and how can I solve it? Thanks for every reply . Not exactly sure how to do this. What I need is when a person clicks on the link ie: page.php?nid=1 then it loads what needs to be loaded but if a user clicks and there is no nid ie: page.php?nid= Then it loads something else. if (nid==$nid){ echo "This is the data to show"; }else{ Show this data instead } Both if and else both show different mysql data. Hopefully I explained myself well. |