
elyfrank
Members-
Posts
45 -
Joined
-
Last visited
Everything posted by elyfrank
-
I get this error: Error updating record: Table 'wordpress_i12dhflgoa.postmeta' doesn't exist Here is the code I am using: $sql="update `wp_pzvy_postmeta` set meta_value = '10' where meta_key = '_price' AND post_id=(select post_id from postmeta where meta_key = '_sku' and meta_value = 'GF-1370')";
-
The thing is that I am doing this out of wordpress, it is a separate script running in the server. Hey, Thank you very much for all your help, I will try this out this afternoon and let you know if everything works ok.
-
How can I get the post_Id based on the meta_value? In this case meta_value is GF-1370? Thank you
-
This is the table from myphpadmin. It looks like it got reformatted when I originally posted. meta_id post_id meta_key meta_value 18538 4356 _sku GF-1370 18541 4356 _price 2.343
-
Hi, I changed the code a bit and tried to execute it and I am getting this error: Error updating record: Unknown column '_sku' in 'where clause' Here is the code <?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "myDB"; $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } $sql="update `wp_pzvy_postmeta` set `_price` = 5 WHERE `_sku` = 'GF-1370'"; if (mysqli_query($conn, $sql)) { echo "Record updated successfully"; } else { echo "Error updating record: " . mysqli_error($conn); } mysqli_close($conn);
-
Hi guys, I have a problem with my code. It connects with the database but it doesn't execute anything. I am trying to update a value in a table but I really don't know what I am doing wrong. I am trying to change the price based on the meta_value GF-1370 Thank you very much. Here is Table (Taken from myphpadmin) meta_id post_id meta_key meta_value 18538 4356 _sku GF-1370 18541 4356 _price 2.343 and here is my code: <?php $link = mysql_connect('server', 'username', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_select_db(wordpress_i12dhflgoa); $sql="update `wp_pzvy_postmeta` set `_price` = 5 WHERE `_sku` = 'GF-1370'"; ?>
-
I just fix it. Thank you guys. $result = mysql_query("UPDATE wp_usermeta SET meta_value='0' WHERE meta_key = 'wp_s2member_login_counter';")
-
Hi guys, I know a little bit of PHP but I am very new to mysql. How do I change the value (meta_value) of all the wp_s2member_login_counter in this table (wp_usermeta) using php? Thank you very much! This is what I got so far: <?php // Connect to MySQL $link = mysql_connect('mywebsite.com', 'wrd6rEDgggy', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_select_db(wrd_47io4f3a6l); $result = mysql_query("UPDATE wp_usermeta SET wp_s2member_login_counter='0'") or die(mysql_error()); ?>
-
Hi guys, I managed to write this script to open a link in internet explorer close it and open another one. I would like to have all my links in a different txt files with multiple links line by line and be able to do the same function reading it from the bat file I will appreciate anybody that can help me with this. This is the bat file I made which works great. It opens these two llinks one at a time and do some stuff. @echo off start /MIN iexplore.exe www.website1.com ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 tskill iexplore /A RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 start /MIN iexplore.exe www.website2.com ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 ping 192.178.1.1 -w 1 tskill iexplore /A RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 Thank you very much
-
- bat files
- read txt file
-
(and 2 more)
Tagged with:
-
Requinix, I used this RedirectMatch (example-)*\.html$ http://www.example.com$1.html And the output was: www.example.com.html At least it is recognizing the beginning of all my urls but I am missing something.
-
How can I do it with redirect match? Thank you
-
The .htaccess and the files are in the same folder. I know the htaccess is working because all the lines above and below that are doing what they suppose to do.
-
Nope, didn't work
-
Requinix, Thank you for the quick response, however for some reason this is not working for me. (it doesn't redirect) this is my htaccess code Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] RewriteEngine on RewriteRule ^example-(\d+)\.html$ /$1.html [L,R] addtype application/x-httpd-php .html AddHandler x-httpd-php .html AddType application/x-shockwave-flash .swf
-
Hi guys, I have several urls that I would like to redirect using one line in my .htaccess example: http://www.example.com/example-1.html redirect to http://www.example.com/1.html I just pretty much want to take out the beguining (example-) of multiple urls Thank you very much.
-
Psycho, I am sorry to bother you. How can I extract this text using preg_match_all? Where Read all reviews from is the beguining and ') is the end? 'Read all reviews from text-to-extract') I having trouble with the delimiters. This is what I got so far: preg_match_all("#Read all reviews from \('([^']')*)#", $text, $matches); but is not working. Thank you very much.
-
Thank you Psycho, it worked great.
-
Hi guys, I hope you guys are having a terrific day. I am trying to get some data from a page using preg_match an place it in an array. This is the PHP code I got so far: <?php $url = "http://www.examplepage.html"; $raw = file_get_contents($url); preg_match("/<ul class='Codes'>(.*)<\/ul>/isU",$raw,$output); echo $output[1]; ?> I am able to read all text between <ul class='Codes'></ul> which is the one I am showing below. Result from PHP code above: <li><script type='text/javascript'>Code.number('4.236173.USD.EN.057880560561287921.386595955', '')</script><img src='/Images/providers/logos/Logo1.gif?cdn=040309' alt='' /> <script type='text/javascript'>Code.number('4.236173.USD.EN.057880560561287921.386595955', 'Read all codes from Number1')</script></li><li><script type='text/javascript'>Code.number('4.1957403.USD.EN.057880560561287921.458090474', '')</script><img src='/Images/providers/logos/logo2.gif?cdn=040309' alt='' /> <script type='text/javascript'>Code.number('4.1957403.USD.EN.057880560561287921.458090474', 'Read all codes from Number2')</script></li><li><script type='text/javascript'>Code.number('4.4801652.USD.EN.057880560561287921.1469771421', '')</script><img src='/Images/providers/logos/Logo6.gif?cdn=040309' alt='' /> <script type='text/javascript'>Code.number('4.4801652.USD.EN.057880560561287921.1469771421', 'Read all codes from Number3')</script></li> This is what I would like to do: Count how many times Code.Number happens. and then for each of then capture and place in array the code number between the ' '. (the first example will be 4.236173.USD.EN.057880560561287921.386595955) and so on. Code Numer 0,1 = 4.236173.USD.EN.057880560561287921.386595955 Code number 0,2= Logo1.gif Code number 1,1 = 4.1957403.USD.EN.057880560561287921.458090474 code number 1,2=Logo2.gif and so on. Thank you very much.